forked from airgap-it/airgap-coin-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
81 lines (74 loc) · 2.44 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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
- qa
- 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 unit-legacy-$CI_COMMIT_SHA || true
script:
- docker run --name unit-$CI_COMMIT_SHA $GOOGLE_TAG /bin/bash -c "npm run install-test-dependencies; npm run test-ci"
- docker run --name lint-$CI_COMMIT_SHA $GOOGLE_TAG /bin/bash -c "npm run install-test-dependencies; npm run lint-ci"
- docker cp unit-$CI_COMMIT_SHA:/app/coverage coverage
- docker cp lint-$CI_COMMIT_SHA:/app/lint-reports lint-reports
after_script:
- docker rm -f unit-$CI_COMMIT_SHA || true
- docker rm -f unit-legacy-$CI_COMMIT_SHA || true
- docker rm -f lint-$CI_COMMIT_SHA || true
tags:
- docker
artifacts:
paths:
- coverage
- lint-reports
qa:
stage: qa
script:
- docker create --name qa-core-$CI_PIPELINE_ID $GOOGLE_TAG npm run sonar-scanner -- -X
-Dsonar.typescript.lcov.reportPaths=lcov.info
-Dsonar.typescript.tslint.reportPaths=lintReport.json
-Dsonar.test.inclusions=packages/core/**/*.spec.ts
-Dsonar.tests=packages/core/src/
-Dsonar.exclusions=**/node_modules/**,**/*.spec.ts,src/dependencies/**
-Dsonar.sources=packages/core/src/
-Dsonar.host.url=$SONAR_URL
-Dsonar.login=$SONAR_LOGIN
-Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
-Dsonar.gitlab.project_id=$CI_PROJECT_ID
-Dsonar.branch.name=$CI_BUILD_REF_NAME
- docker cp coverage/core/lcov.info qa-core-$CI_PIPELINE_ID:/app/lcov.info
- docker cp lint-reports/core.json qa-core-$CI_PIPELINE_ID:/app/lintReport.json
- docker start -a qa-core-$CI_PIPELINE_ID
after_script:
- docker rm -f qa-core-$CI_PIPELINE_ID || true
tags:
- docker
publish_beta:
stage: publish
when: manual
script:
- docker run --env NPM_AUTH_TOKEN --name unit-$CI_COMMIT_SHA $GOOGLE_TAG ./npm-ci-publish-beta-only.sh
tags:
- docker
publish:
stage: publish
only:
- master
when: manual
script:
- docker run --env NPM_AUTH_TOKEN --name unit-$CI_COMMIT_SHA $GOOGLE_TAG ./npm-ci-publish.sh
tags:
- docker