Files
pezkuwi-telemetry/.gitlab-ci.yml
T
arshamparity 699c19736f Gitlab ci (#390)
* adding values-parity.yaml to the project again

* removing the custom values file

* replacing the namespace with variable

* removing the default configuration for frontend nginx

* fixing the CI
2021-08-31 16:11:13 +03:00

73 lines
2.5 KiB
YAML

variables:
BACKEND_CONTAINER_REPO: "docker.io/parity/substrate-telemetry-backend"
FRONTEND_CONTAINER_REPO: "docker.io/parity/substrate-telemetry-frontend"
BACKEND_IMAGE_FULL_NAME: "${BACKEND_CONTAINER_REPO}:${CI_COMMIT_SHORT_SHA}-beta"
FRONTEND_IMAGE_FULL_NAME: "${FRONTEND_CONTAINER_REPO}:${CI_COMMIT_SHORT_SHA}-beta"
KUBE_NAMESPACE: "substrate-telemetry"
stages:
- dockerize
- staging
.dockerize: &dockerize
stage: dockerize
image: quay.io/buildah/stable
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: always
tags:
- kubernetes-parity-build
.deploy-k8s: &deploy-k8s
image: paritytech/kubetools:3.5.3
script:
- |-
helm repo add parity https://paritytech.github.io/helm-charts/
helm repo update
kubectl get cm helm-custom-values -n $KUBE_NAMESPACE -o jsonpath='{.data.values-parity\.yaml}' > values-parity.yaml
- helm upgrade
--install
--atomic
--timeout 120s
--create-namespace
--namespace $KUBE_NAMESPACE
--set image.backend.repository="${BACKEND_CONTAINER_REPO}"
--set image.backend.tag="${CI_COMMIT_SHORT_SHA}-beta"
--set image.frontend.repository="${FRONTEND_CONTAINER_REPO}"
--set image.frontend.tag="${CI_COMMIT_SHORT_SHA}-beta"
--values values-parity.yaml
$KUBE_NAMESPACE parity/substrate-telemetry
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
tags:
- kubernetes-parity-build
dockerize-backend:
<<: *dockerize
script:
- echo "Building image $BACKEND_IMAGE_FULL_NAME"
- buildah bud
--format=docker
--tag "$BACKEND_IMAGE_FULL_NAME" ./backend/
- echo ${Docker_Hub_Pass_Parity} |
buildah login --username ${Docker_Hub_User_Parity} --password-stdin docker.io
- buildah push --format=v2s2 "$BACKEND_IMAGE_FULL_NAME"
dockerize-frontend:
<<: *dockerize
script:
- echo "Building image $FRONTEND_IMAGE_FULL_NAME"
- buildah bud
--format=docker
--tag "$FRONTEND_IMAGE_FULL_NAME" ./frontend/
- echo ${Docker_Hub_Pass_Parity} |
buildah login --username ${Docker_Hub_User_Parity} --password-stdin docker.io
- buildah push --format=v2s2 "$FRONTEND_IMAGE_FULL_NAME"
deploy-parity-stg:
stage: staging
<<: *deploy-k8s
environment:
name: parity-stg