dashboard/.gitlab-ci.yml

70 lines
2 KiB
YAML
Raw Normal View History

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:
CHART_NAME: stackspin-dashboard
2021-12-13 09:45:55 +01:00
CHART_DIR: deployment/helmchart/
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
.kaniko-build:
script:
- cd ${DIRECTORY}
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- export CONTAINER_TAG=${CI_COMMIT_TAG:-${CI_COMMIT_REF_SLUG}}
- /kaniko/executor --cache=true --context ${CI_PROJECT_DIR}/${DIRECTORY} --destination ${CI_REGISTRY_IMAGE}/${KANIKO_BUILD_IMAGENAME}:${CONTAINER_TAG}
build-fontend-container:
2021-09-29 15:20:02 +02:00
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: [""]
variables:
KANIKO_BUILD_IMAGENAME: dashboard
DIRECTORY: web-build
before_script:
- cp deployment/Dockerfile $DIRECTORY
- cp deployment/nginx.conf $DIRECTORY
extends:
.kaniko-build
build-backend-container:
stage: build-container
variables:
KANIKO_BUILD_IMAGENAME: dashboard-backend
DIRECTORY: backend
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: [""]
extends:
.kaniko-build