2019-11-02 00:54:48 +00:00
|
|
|
include:
|
2022-02-02 16:33:42 +00:00
|
|
|
- local: /.gitlab/ci-tools.yml
|
|
|
|
- local: /.gitlab/ci-rules.yml
|
2019-11-02 00:54:48 +00:00
|
|
|
|
2019-06-16 04:08:12 +00:00
|
|
|
stages:
|
|
|
|
- status-pre
|
|
|
|
- build
|
|
|
|
- image
|
|
|
|
- publish
|
|
|
|
- status-post
|
|
|
|
|
|
|
|
# build jobs
|
|
|
|
build-node:
|
2019-11-10 15:59:58 +00:00
|
|
|
stage: build
|
2019-11-02 00:57:54 +00:00
|
|
|
extends:
|
|
|
|
- .build-node
|
2019-06-16 04:08:12 +00:00
|
|
|
|
|
|
|
script:
|
2019-11-02 01:03:21 +00:00
|
|
|
- make ci
|
2019-06-16 04:08:12 +00:00
|
|
|
|
|
|
|
artifacts:
|
2019-11-02 01:25:51 +00:00
|
|
|
when: always
|
|
|
|
expire_in: 1 day
|
2019-06-16 04:08:12 +00:00
|
|
|
paths:
|
2019-11-02 01:25:51 +00:00
|
|
|
- out/
|
|
|
|
|
2019-06-16 04:08:12 +00:00
|
|
|
cache:
|
|
|
|
key: "${CI_COMMIT_REF_SLUG}"
|
|
|
|
policy: pull-push
|
|
|
|
paths:
|
2019-11-02 01:25:51 +00:00
|
|
|
- node_modules/
|
|
|
|
- out/api
|
2019-07-01 00:12:37 +00:00
|
|
|
- out/cache
|
2019-11-02 01:25:51 +00:00
|
|
|
- out/tmp
|
2019-06-16 04:08:12 +00:00
|
|
|
|
2019-10-31 12:34:39 +00:00
|
|
|
build-image-alpine-branch:
|
2019-11-02 00:57:54 +00:00
|
|
|
extends:
|
|
|
|
- .build-docker
|
2019-11-02 00:59:08 +00:00
|
|
|
stage: image
|
2019-07-01 01:36:04 +00:00
|
|
|
except:
|
|
|
|
- tags
|
2019-11-01 23:48:59 +00:00
|
|
|
script:
|
|
|
|
- ./scripts/docker-build.sh --push --default
|
2019-07-01 01:36:04 +00:00
|
|
|
variables:
|
2019-10-30 23:53:44 +00:00
|
|
|
IMAGE_ARCH: alpine
|
2019-07-01 01:36:04 +00:00
|
|
|
|
2019-10-31 12:34:39 +00:00
|
|
|
build-image-alpine-tag:
|
2019-11-02 00:57:54 +00:00
|
|
|
extends:
|
|
|
|
- .build-docker
|
2019-11-02 00:59:08 +00:00
|
|
|
stage: image
|
2019-07-01 01:36:04 +00:00
|
|
|
only:
|
|
|
|
- tags
|
2019-11-01 23:48:59 +00:00
|
|
|
script:
|
|
|
|
- ./scripts/docker-build.sh --push --default
|
2019-10-30 23:53:44 +00:00
|
|
|
variables:
|
|
|
|
IMAGE_ARCH: alpine
|
2019-07-01 01:36:04 +00:00
|
|
|
|
2019-10-30 23:53:44 +00:00
|
|
|
build-image-stretch-branch:
|
2019-11-02 00:59:08 +00:00
|
|
|
stage: image
|
2019-11-10 15:59:58 +00:00
|
|
|
extends: [.build-docker]
|
2019-10-30 23:53:44 +00:00
|
|
|
except:
|
|
|
|
- tags
|
2019-11-01 23:48:59 +00:00
|
|
|
script:
|
|
|
|
- ./scripts/docker-build.sh --push
|
2019-10-30 23:53:44 +00:00
|
|
|
variables:
|
|
|
|
IMAGE_ARCH: stretch
|
|
|
|
|
|
|
|
build-image-stretch-tag:
|
2019-11-10 15:59:58 +00:00
|
|
|
stage: image
|
2019-11-02 00:57:54 +00:00
|
|
|
extends:
|
|
|
|
- .build-docker
|
2019-10-30 23:53:44 +00:00
|
|
|
only:
|
|
|
|
- tags
|
2019-11-01 23:48:59 +00:00
|
|
|
script:
|
|
|
|
- ./scripts/docker-build.sh --push
|
2019-07-01 01:36:04 +00:00
|
|
|
variables:
|
2019-10-30 23:53:44 +00:00
|
|
|
IMAGE_ARCH: stretch
|
2019-06-16 04:08:12 +00:00
|
|
|
|
|
|
|
# publish jobs
|
|
|
|
publish-npm:
|
2019-11-10 15:59:58 +00:00
|
|
|
stage: publish
|
2019-11-02 00:57:54 +00:00
|
|
|
extends:
|
|
|
|
- .build-node
|
2019-11-10 15:59:58 +00:00
|
|
|
- .deploy-tags
|
2019-06-16 04:08:12 +00:00
|
|
|
|
|
|
|
dependencies:
|
|
|
|
- build-node
|
|
|
|
script:
|
|
|
|
- npm publish
|
|
|
|
|
|
|
|
# commit status
|
2019-11-01 23:48:59 +00:00
|
|
|
climate-pending:
|
|
|
|
stage: status-pre
|
|
|
|
extends:
|
|
|
|
- .build-climate
|
|
|
|
|
|
|
|
script:
|
|
|
|
- cc-test-reporter before-build
|
|
|
|
|
|
|
|
climate-success:
|
|
|
|
stage: status-post
|
|
|
|
extends:
|
|
|
|
- .build-climate
|
|
|
|
|
|
|
|
dependencies:
|
|
|
|
- build-node
|
|
|
|
script:
|
|
|
|
- make upload-climate
|
|
|
|
|
2019-06-16 04:08:12 +00:00
|
|
|
github-pending:
|
2019-11-10 15:59:58 +00:00
|
|
|
stage: status-pre
|
2019-11-01 23:59:39 +00:00
|
|
|
extends:
|
|
|
|
- .build-curl
|
2019-06-16 04:08:12 +00:00
|
|
|
script:
|
|
|
|
- ./scripts/github-status.sh pending
|
|
|
|
|
|
|
|
github-failure:
|
2019-11-10 15:59:58 +00:00
|
|
|
stage: status-post
|
2019-11-01 23:59:39 +00:00
|
|
|
extends:
|
|
|
|
- .build-curl
|
2019-06-16 04:08:12 +00:00
|
|
|
when: on_failure
|
|
|
|
script:
|
|
|
|
- ./scripts/github-status.sh failure
|
|
|
|
|
|
|
|
github-success:
|
2019-11-10 15:59:58 +00:00
|
|
|
stage: status-post
|
2019-11-01 23:59:39 +00:00
|
|
|
extends:
|
|
|
|
- .build-curl
|
2019-06-16 04:08:12 +00:00
|
|
|
when: on_success
|
|
|
|
script:
|
|
|
|
- ./scripts/github-status.sh success
|
2019-11-10 15:59:58 +00:00
|
|
|
|
|
|
|
sonar-success:
|
|
|
|
stage: status-post
|
|
|
|
extends:
|
|
|
|
- .build-sonar
|
|
|
|
|
|
|
|
when: on_success
|
|
|
|
script:
|
|
|
|
- make node_modules
|
|
|
|
- sonar-scanner
|
|
|
|
-Dsonar.projectKey=ssube_salty-dog
|
|
|
|
-Dsonar.projectVersion=${CI_COMMIT_REF_SLUG}
|
|
|
|
-Dsonar.organization=ssube-github
|
|
|
|
-Dsonar.sources=src/,test/
|
|
|
|
-Dsonar.host.url=https://sonarcloud.io
|
|
|
|
-Dsonar.login=${SONAR_SECRET}
|
|
|
|
-Dsonar.typescript.lcov.reportPaths=out/coverage/lcov.info
|