forked from airgap-it/beacon-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
84 lines (77 loc) · 2.49 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
82
83
84
image: docker:latest
variables:
GOOGLE_TAG: eu.gcr.io/papers-kubernetes/beacon-sdk:$CI_COMMIT_SHA
GOOGLE_TAG_LATEST: eu.gcr.io/papers-kubernetes/beacon-sdk:latest
stages:
- build
# - test
# - qa
- publish
build:
stage: build
script:
- docker build -t $GOOGLE_TAG .
tags:
- docker
# unit:
# stage: test
# script:
# - docker run --name unit-$CI_COMMIT_SHA $GOOGLE_TAG npm run test-ci
# - docker run --name lint-$CI_COMMIT_SHA $GOOGLE_TAG npm run lint-ci
# # - docker run --name audit-$CI_COMMIT_SHA $GOOGLE_TAG npm run audit-ci
# - docker cp unit-$CI_COMMIT_SHA:/app/coverage/lcov.info lcov.info
# - docker cp lint-$CI_COMMIT_SHA:/app/lintReport.json lintReport.json
# # - docker cp audit-$CI_COMMIT_SHA:/app/gl-dependency-scanning-report.json gl-dependency-scanning-report.json
# after_script:
# - docker rm -f unit-$CI_COMMIT_SHA || true
# - docker rm -f lint-$CI_COMMIT_SHA || true
# # - docker rm -f audit-$CI_COMMIT_SHA || true
# tags:
# - docker
# artifacts:
# paths:
# - lcov.info
# - lintReport.json
# # reports:
# # dependency_scanning: [gl-dependency-scanning-report.json]
# qa:
# stage: qa
# before_script:
# - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# script:
# - docker create --name qa-$CI_PIPELINE_ID $IMAGE_TAG_CURRENT npm run sonar-scanner -- -X
# -Dsonar.typescript.lcov.reportPaths=lcov.info
# -Dsonar.typescript.tslint.reportPaths=lintReport.json
# -Dsonar.test.inclusions=**/*.spec.ts
# -Dsonar.tests=src/
# -Dsonar.exclusions=**/node_modules/**,**/*.spec.ts
# -Dsonar.sources=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 lcov.info qa-$CI_PIPELINE_ID:/app/lcov.info
# - docker cp lintReport.json qa-$CI_PIPELINE_ID:/app/lintReport.json
# - docker start -a qa-$CI_PIPELINE_ID
# after_script:
# - docker rm -f qa-$CI_PIPELINE_ID || true
# tags:
# - docker
publish_beta:
stage: publish
when: manual
script:
- docker run --env NPM_AUTH_TOKEN --rm $GOOGLE_TAG ./npm-ci-publish-beta-only.sh
tags:
- docker
publish:
stage: publish
only:
- master
when: manual
script:
- docker run --env NPM_AUTH_TOKEN --rm $GOOGLE_TAG ./npm-ci-publish.sh
tags:
- docker