2021-12-13 09:45:55 +01:00
|
|
|
include:
|
|
|
|
- remote: https://open.greenhost.net/stackspin/stackspin/-/raw/main/.gitlab/ci_templates/helm_package.yml
|
|
|
|
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
|
|
|
|
|
2021-09-29 15:20:02 +02:00
|
|
|
stages:
|
|
|
|
- build-project
|
|
|
|
- build-container
|
2021-12-13 09:45:55 +01:00
|
|
|
- lint-helm-chart
|
|
|
|
- package-helm-chart
|
|
|
|
- release-helm-chart
|
2021-09-29 15:20:02 +02:00
|
|
|
|
2021-09-29 15:21:45 +02:00
|
|
|
image: node:14-alpine
|
|
|
|
|
2021-09-29 15:20:02 +02:00
|
|
|
variables:
|
2021-12-13 16:57:24 +01:00
|
|
|
CHART_NAME: stackspin-dashboard
|
2021-12-13 09:45:55 +01:00
|
|
|
CHART_DIR: deployment/helmchart/
|
2021-11-22 15:38:37 +01:00
|
|
|
KANIKO_BUILD_IMAGENAME: dashboard
|
2021-09-29 15:20:02 +02:00
|
|
|
|
|
|
|
build-project:
|
|
|
|
stage: build-project
|
|
|
|
before_script: []
|
|
|
|
script:
|
|
|
|
- echo "Building app"
|
2021-09-29 15:27:55 +02:00
|
|
|
- yarn install
|
2021-10-06 14:38:20 +02:00
|
|
|
- echo "REACT_APP_API_URL=/api/v1" > .env
|
|
|
|
- echo "EXTEND_ESLINT=true" >> .env
|
2021-09-29 15:20:02 +02:00
|
|
|
- yarn build
|
|
|
|
- mv build web-build
|
|
|
|
- echo "Build successful"
|
|
|
|
artifacts:
|
|
|
|
expire_in: 1 hour
|
|
|
|
name: web-build
|
|
|
|
paths:
|
|
|
|
- web-build
|
|
|
|
|
|
|
|
build-container:
|
|
|
|
stage: build-container
|
|
|
|
image:
|
|
|
|
# We need a shell to provide the registry credentials, so we need to use the
|
|
|
|
# kaniko debug image (https://github.com/GoogleContainerTools/kaniko#debug-image)
|
|
|
|
name: gcr.io/kaniko-project/executor:debug
|
|
|
|
entrypoint: [""]
|
|
|
|
script:
|
|
|
|
- cp deployment/Dockerfile web-build
|
|
|
|
- cp deployment/nginx.conf web-build
|
|
|
|
- cd web-build
|
|
|
|
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
2021-11-02 16:22:53 +01:00
|
|
|
- /kaniko/executor --cache=true --context ${CI_PROJECT_DIR}/web-build --destination ${CI_REGISTRY_IMAGE}/${KANIKO_BUILD_IMAGENAME}:${CI_COMMIT_REF_SLUG}
|