2021-01-24 21:16:22 +01:00
|
|
|
include:
|
2021-08-21 19:23:43 +02:00
|
|
|
- local: 'ci_templates/.cic-template.yml'
|
|
|
|
- local: 'apps/contract-migration/.gitlab-ci.yml'
|
2021-02-04 05:36:32 +01:00
|
|
|
- local: 'apps/cic-eth/.gitlab-ci.yml'
|
2021-02-06 19:28:08 +01:00
|
|
|
- local: 'apps/cic-ussd/.gitlab-ci.yml'
|
2021-02-07 03:29:24 +01:00
|
|
|
- local: 'apps/cic-notify/.gitlab-ci.yml'
|
2021-02-08 18:31:29 +01:00
|
|
|
- local: 'apps/cic-meta/.gitlab-ci.yml'
|
2021-02-18 06:04:30 +01:00
|
|
|
- local: 'apps/cic-cache/.gitlab-ci.yml'
|
2021-08-21 19:23:43 +02:00
|
|
|
- local: 'apps/data-seeding/.gitlab-ci.yml'
|
2021-01-24 21:16:22 +01:00
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
2021-08-23 18:50:05 +02:00
|
|
|
- deploy
|
|
|
|
|
|
|
|
|
|
|
|
deploy-k8s-dev:
|
2021-08-23 19:40:32 +02:00
|
|
|
stage: deploy
|
|
|
|
image: dtzar/helm-kubectl
|
|
|
|
variables:
|
|
|
|
CI_DEBUG_TRACE: "true"
|
|
|
|
script:
|
2021-08-23 22:46:17 +02:00
|
|
|
- kubectl config set-cluster k8s --server="${K8S_DEV_SERVER?dev server missing}"
|
2021-08-23 19:40:32 +02:00
|
|
|
- kubectl config set clusters.k8s.certificate-authority-data ${K8S_DEV_CERTIFICATE_AUTHORITY_DATA}
|
|
|
|
- kubectl config set-credentials gitlab --token="${K8S_DEV_USER_TOKEN}"
|
2021-08-23 22:46:17 +02:00
|
|
|
- kubectl config set-context grassroots --cluster=k8s --user=gitlab --namespace grassroots
|
|
|
|
- kubectl config use-context grassroots
|
2021-08-23 19:40:32 +02:00
|
|
|
#- sed -i "s/<VERSION>/${CI_COMMIT_SHORT_SHA}/g" deployment.yaml
|
|
|
|
#- kubectl apply -f deployment.yaml
|
2021-08-23 22:46:17 +02:00
|
|
|
- echo "Wiping state..."
|
|
|
|
- kubectl delete jobs.batch --all
|
|
|
|
- kubectl delete hr postgresql && kubectl delete --wait=false pvc -l 'app.kubernetes.io/name=postgresql'
|
|
|
|
- kubectl delete sts,pvc -l 'app=bloxberg-validator'
|
|
|
|
- kubectl delete hr redis && kubectl delete --wait=false pvc -l 'app=redis'
|
2021-08-23 22:52:41 +02:00
|
|
|
- kubectl apply -f kubernetes/eth-node/ -f kubernetes/postgresql/ -f kubernetes/redis/
|
2021-08-23 22:46:17 +02:00
|
|
|
- echo "run database migrations..."
|
|
|
|
- kubectl rollout restart deployments
|
|
|
|
- echo "run contract migrations..."
|
2021-08-23 22:52:41 +02:00
|
|
|
- kubectl apply -f kubernetes/contract-migration/contract-migration-job.yaml
|
2021-08-23 22:46:17 +02:00
|
|
|
- kubectl delete job --all
|