Skip to content
Snippets Groups Projects
Commit 93fe4643 authored by Dobromir Palushev's avatar Dobromir Palushev
Browse files

Merge branch 'staging' into 'main'

Pipeline fix

See merge request !64
parents 77dd98d6 afc1098a
No related branches found
No related tags found
1 merge request!64Pipeline fix
Pipeline #19271 passed with warnings
......@@ -21,6 +21,7 @@ stages:
- upgrade-connection
.gke-initialization:
image: google/cloud-sdk:${GOOGLE_CLOUD_SDK_IMAGE_VERSION}
before_script:
- echo $BASE64_GOOGLE_CREDENTIALS | base64 -d > ~/service_account.json
- gcloud auth activate-service-account --key-file ~/service_account.json
......@@ -32,9 +33,8 @@ stages:
extends: .gke-initialization
tags:
- docker
image: google/cloud-sdk:${GOOGLE_CLOUD_SDK_IMAGE_VERSION}
script:
- IMAGE="${CI_REGISTRY_IMAGE}:${VERSION}"
- IMAGE="${CI_REGISTRY_IMAGE}:$VERSION"
- cd "./k8s-manifests"
- kubectl apply -f gitlab-registry-credentials.yaml --namespace "${ENVIRONMENT_NAME}-${K8S_NAMESPACE}"
- SECRETS_MANIFEST=$(sed -e "s,{{jwtSecret}},${JWT_SECRET},g" ./secrets.yaml.tmpl)
......@@ -153,7 +153,7 @@ deploy-new-staging-version:
- when: never
deploy-new-release:
extends: .gke-deployment
extends: .gke-initialization
stage: deploy
needs:
- 'create-release-image'
......@@ -163,8 +163,22 @@ deploy-new-release:
variables:
ENVIRONMENT_NAME: production
STATIC_IP: todoapp-ip
VERSION: $(grep '"version"' ./app/client/package.json | cut -d '"' -f 4 | head -n 1)
- when: never
tags:
- docker
script:
- VERSION=$(grep '"version"' ./app/client/package.json | cut -d '"' -f 4 | head -n 1)
- IMAGE="${CI_REGISTRY_IMAGE}:$VERSION"
- cd "./k8s-manifests"
- kubectl apply -f gitlab-registry-credentials.yaml --namespace "${ENVIRONMENT_NAME}-${K8S_NAMESPACE}"
- SECRETS_MANIFEST=$(sed -e "s,{{jwtSecret}},${JWT_SECRET},g" ./secrets.yaml.tmpl)
- echo "${SECRETS_MANIFEST}" | kubectl apply --namespace "${ENVIRONMENT_NAME}-${K8S_NAMESPACE}" --filename -
- kubectl apply -f configmap.yaml --namespace "${ENVIRONMENT_NAME}-${K8S_NAMESPACE}"
- DEPLOYMENT_MANIFEST=$(sed -e "s,{{image}},${IMAGE},g" ./deployment.yaml.tmpl)
- echo "${DEPLOYMENT_MANIFEST}" | kubectl apply --namespace "${ENVIRONMENT_NAME}-${K8S_NAMESPACE}" --filename -
- kubectl apply -f service.yaml --namespace "${ENVIRONMENT_NAME}-${K8S_NAMESPACE}"
- INGRESS_MANIFEST=$(sed -e "s,{{static-ip-name}},${STATIC_IP},g" -e "s,{{allowHttpFlag}},true,g" -e "s,{{portNumber}},80,g" ./ingress.yaml.tmpl)
- echo "${INGRESS_MANIFEST}" | kubectl apply --namespace "${ENVIRONMENT_NAME}-${K8S_NAMESPACE}" --filename -
switch-to-https:
extends: .gke-initialization
......@@ -182,7 +196,6 @@ switch-to-https:
ENVIRONMENT_NAME: production
tags:
- docker
image: google/cloud-sdk:${GOOGLE_CLOUD_SDK_IMAGE_VERSION}
script:
- INGRESS_MANIFEST=$(sed -e "s,{{static-ip-name}},${STATIC_IP},g" -e "s,{{allowHttpFlag}},false,g" -e "s,{{portNumber}},443,g" ./k8s-manifests/ingress.yaml.tmpl)
- echo "${INGRESS_MANIFEST}" | kubectl apply --namespace "${ENVIRONMENT_NAME}-${K8S_NAMESPACE}" --filename -
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment