1
0
Fork 0
salty-dog/.gitlab-ci.yml

160 lines
2.6 KiB
YAML
Raw Normal View History

2019-11-02 00:54:48 +00:00
include:
- local: /config/gitlab/ci-tools.yml
- local: /config/gitlab/ci-rules.yml
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
- 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
script:
- ./scripts/docker-build.sh --push --default
2019-07-01 01:36:04 +00:00
variables:
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
script:
- ./scripts/docker-build.sh --push --default
variables:
IMAGE_ARCH: alpine
2019-07-01 01:36:04 +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]
except:
- tags
script:
- ./scripts/docker-build.sh --push
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
only:
- tags
script:
- ./scripts/docker-build.sh --push
2019-07-01 01:36:04 +00:00
variables:
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
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
codecov-success:
stage: status-post
extends:
- .build-codecov
when: on_success
dependencies:
- build-node
script:
- make upload-codecov
2019-06-16 04:08:12 +00:00
github-pending:
2019-11-10 15:59:58 +00:00
stage: status-pre
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
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
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