2019-09-17 13:05:36 +00:00
|
|
|
include:
|
2019-09-17 13:08:40 +00:00
|
|
|
- local: /config/gitlab/ci-tools.yml
|
|
|
|
- local: /config/gitlab/ci-rules.yml
|
2019-09-17 13:05:36 +00:00
|
|
|
|
2019-09-17 12:45:15 +00:00
|
|
|
stages:
|
|
|
|
- status-pre
|
|
|
|
- build
|
|
|
|
- image
|
|
|
|
- publish
|
|
|
|
- status-post
|
|
|
|
|
|
|
|
# build jobs
|
|
|
|
build-node:
|
2019-11-10 16:00:53 +00:00
|
|
|
stage: build
|
2019-09-17 13:05:36 +00:00
|
|
|
extends:
|
|
|
|
- .build-node
|
2019-09-17 12:45:15 +00:00
|
|
|
|
|
|
|
script:
|
2019-09-28 20:24:51 +00:00
|
|
|
- make ci
|
2019-09-17 12:45:15 +00:00
|
|
|
|
|
|
|
artifacts:
|
2019-11-10 02:02:22 +00:00
|
|
|
when: always
|
2019-09-17 13:18:30 +00:00
|
|
|
expire_in: 1 day
|
2019-09-17 12:45:15 +00:00
|
|
|
paths:
|
2019-09-17 13:05:36 +00:00
|
|
|
- out/
|
2019-09-17 13:18:30 +00:00
|
|
|
|
2019-09-17 12:45:15 +00:00
|
|
|
cache:
|
|
|
|
key: "${CI_COMMIT_REF_SLUG}"
|
|
|
|
policy: pull-push
|
|
|
|
paths:
|
2019-09-17 13:05:36 +00:00
|
|
|
- node_modules/
|
2019-11-10 02:02:22 +00:00
|
|
|
- out/api
|
|
|
|
- out/cache
|
|
|
|
- out/tmp
|
2019-09-17 13:05:36 +00:00
|
|
|
|
2019-11-10 02:02:22 +00:00
|
|
|
build-image-alpine-branch:
|
2019-09-17 13:05:36 +00:00
|
|
|
extends:
|
|
|
|
- .build-docker
|
2019-11-10 02:02:22 +00:00
|
|
|
stage: image
|
|
|
|
except:
|
|
|
|
- tags
|
|
|
|
script:
|
|
|
|
- ./scripts/docker-build.sh --push --default
|
|
|
|
variables:
|
|
|
|
IMAGE_ARCH: alpine
|
2019-09-17 13:05:36 +00:00
|
|
|
|
2019-11-10 02:02:22 +00:00
|
|
|
build-image-alpine-tag:
|
|
|
|
extends:
|
|
|
|
- .build-docker
|
|
|
|
stage: image
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
script:
|
|
|
|
- ./scripts/docker-build.sh --push --default
|
|
|
|
variables:
|
|
|
|
IMAGE_ARCH: alpine
|
2019-09-17 13:05:36 +00:00
|
|
|
|
2019-11-10 02:02:22 +00:00
|
|
|
build-image-stretch-branch:
|
2019-09-17 13:05:36 +00:00
|
|
|
stage: image
|
2019-11-10 16:00:53 +00:00
|
|
|
extends: [.build-docker]
|
2019-11-10 02:02:22 +00:00
|
|
|
except:
|
|
|
|
- tags
|
|
|
|
script:
|
|
|
|
- ./scripts/docker-build.sh --push
|
|
|
|
variables:
|
|
|
|
IMAGE_ARCH: stretch
|
|
|
|
|
|
|
|
build-image-stretch-tag:
|
2019-11-10 16:00:53 +00:00
|
|
|
stage: image
|
2019-09-17 13:05:36 +00:00
|
|
|
extends:
|
|
|
|
- .build-docker
|
2019-11-10 02:02:22 +00:00
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
script:
|
|
|
|
- ./scripts/docker-build.sh --push
|
|
|
|
variables:
|
|
|
|
IMAGE_ARCH: stretch
|
2019-09-17 12:45:15 +00:00
|
|
|
|
|
|
|
# publish jobs
|
|
|
|
publish-npm:
|
2019-11-10 16:00:53 +00:00
|
|
|
stage: publish
|
2019-09-17 13:05:36 +00:00
|
|
|
extends:
|
|
|
|
- .build-node
|
2019-11-10 16:00:53 +00:00
|
|
|
- .deploy-tags
|
2019-09-17 12:45:15 +00:00
|
|
|
|
|
|
|
dependencies:
|
|
|
|
- build-node
|
|
|
|
script:
|
|
|
|
- npm publish
|
|
|
|
|
|
|
|
# commit status
|
|
|
|
climate-pending:
|
|
|
|
stage: status-pre
|
2019-09-17 13:05:36 +00:00
|
|
|
extends:
|
|
|
|
- .build-climate
|
|
|
|
|
2019-09-17 12:45:15 +00:00
|
|
|
script:
|
|
|
|
- cc-test-reporter before-build
|
|
|
|
|
|
|
|
climate-success:
|
|
|
|
stage: status-post
|
2019-09-17 13:05:36 +00:00
|
|
|
extends:
|
|
|
|
- .build-climate
|
|
|
|
|
2019-09-17 12:45:15 +00:00
|
|
|
dependencies:
|
|
|
|
- build-node
|
|
|
|
script:
|
|
|
|
- make upload-climate
|
|
|
|
|
|
|
|
codecov-success:
|
|
|
|
stage: status-post
|
2019-09-17 13:05:36 +00:00
|
|
|
extends:
|
|
|
|
- .build-codecov
|
|
|
|
|
2019-09-17 12:45:15 +00:00
|
|
|
when: on_success
|
|
|
|
dependencies:
|
|
|
|
- build-node
|
|
|
|
script:
|
|
|
|
- make upload-codecov
|
|
|
|
|
|
|
|
github-pending:
|
2019-11-10 16:00:53 +00:00
|
|
|
stage: status-pre
|
2019-09-17 13:05:36 +00:00
|
|
|
extends:
|
|
|
|
- .build-curl
|
2019-09-17 12:45:15 +00:00
|
|
|
script:
|
2019-11-10 02:02:22 +00:00
|
|
|
- ./scripts/github-status.sh pending
|
2019-09-17 12:45:15 +00:00
|
|
|
|
|
|
|
github-failure:
|
2019-11-10 16:00:53 +00:00
|
|
|
stage: status-post
|
2019-09-17 13:05:36 +00:00
|
|
|
extends:
|
|
|
|
- .build-curl
|
2019-09-17 12:45:15 +00:00
|
|
|
when: on_failure
|
|
|
|
script:
|
2019-11-10 02:02:22 +00:00
|
|
|
- ./scripts/github-status.sh failure
|
2019-09-17 12:45:15 +00:00
|
|
|
|
|
|
|
github-success:
|
2019-11-10 16:00:53 +00:00
|
|
|
stage: status-post
|
2019-09-17 13:05:36 +00:00
|
|
|
extends:
|
|
|
|
- .build-curl
|
2019-09-17 12:45:15 +00:00
|
|
|
when: on_success
|
|
|
|
script:
|
2019-11-10 02:02:22 +00:00
|
|
|
- ./scripts/github-status.sh success
|
2019-11-10 16:00:53 +00:00
|
|
|
|
|
|
|
sonar-success:
|
|
|
|
stage: status-post
|
|
|
|
extends:
|
|
|
|
- .build-sonar
|
|
|
|
|
|
|
|
when: on_success
|
|
|
|
script:
|
|
|
|
- make node_modules
|
|
|
|
- sonar-scanner
|
|
|
|
-Dsonar.projectKey=ssube_rollup-template
|
|
|
|
-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
|