-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
46 lines (42 loc) · 1.27 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
stages:
- prepare
- test
- deploy
variables:
IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}
prepare:
stage: prepare
tags:
- docker-builder
script:
- docker build -t ${IMAGE} .
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker push ${IMAGE}
test:
stage: test
tags:
- pegasys-build-runner
before_script:
- docker-compose -p ${CI_JOB_ID} -f docker-compose.test.yml build
script:
- docker-compose -p ${CI_JOB_ID} -f docker-compose.test.yml run contracts-env npm run test
after_script:
- docker-compose -p ${CI_JOB_ID} -f docker-compose.test.yml run contracts-env npm run ci:clean
- docker-compose -p ${CI_JOB_ID} -f docker-compose.test.yml down
.image_step:
image: ${IMAGE}
tags:
- docker
deploy:
extends: .image_step
stage: deploy
script:
- echo @pegasys-tech:registry=https://gitlab.com/api/v4/packages/npm/ >> .npmrc
- echo //gitlab.com/api/v4/packages/npm/:_authToken=${CI_JOB_TOKEN} >> .npmrc
- echo //gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN} >> .npmrc
- ${VERSION}
- npm --no-git-tag-version version prerelease --preid=beta-$CI_COMMIT_SHORT_SHA
- npm --tag $CI_COMMIT_REF_NAME publish
only:
- master
- merge_requests