-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
53 lines (47 loc) · 1.28 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
image: docker:latest
variables:
GOOGLE_TAG: eu.gcr.io/papers-kubernetes/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_SHA
GOOGLE_TAG_LATEST: eu.gcr.io/papers-kubernetes/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:latest
stages:
- build
- test
- publish
build:
stage: build
script:
- docker build -t $GOOGLE_TAG .
tags:
- docker
unit:
stage: test
before_script:
- docker rm -f unit-$CI_COMMIT_SHA || true
- docker rm -f lint-$CI_COMMIT_SHA || true
script:
- docker run --name unit-$CI_COMMIT_SHA $GOOGLE_TAG /bin/bash -c "npm run test:ci"
- docker run --name lint-$CI_COMMIT_SHA $GOOGLE_TAG /bin/bash -c "npm run lint:ci"
after_script:
- docker rm -f unit-$CI_COMMIT_SHA || true
- docker rm -f lint-$CI_COMMIT_SHA || true
tags:
- docker
publish:
stage: publish
only:
- master
when: manual
script:
- docker run --env NPM_AUTH_TOKEN --name publish-$CI_COMMIT_SHA $GOOGLE_TAG ./npm-ci-publish.sh
after_script:
- docker rm -f publish-$CI_COMMIT_SHA || true
tags:
- docker
publish_beta:
stage: publish
when: manual
script:
- docker run --env NPM_AUTH_TOKEN --name publish-$CI_COMMIT_SHA $GOOGLE_TAG ./npm-ci-publish-beta-only.sh
after_script:
- docker rm -f publish-$CI_COMMIT_SHA || true
tags:
- docker