Replace container image dynamically using kustomization.yaml

This commit is contained in:
Daniel_I_Am 2021-09-03 23:40:13 +02:00
parent 3f270e0f88
commit fe38f88e73
3 changed files with 6 additions and 1 deletions

View File

@ -51,6 +51,7 @@ deploy-job:
- cp "$ENV_PRODUCTION" "./build/.env.production"
- cp "$MYSQL_ENV" "./build/mysql-secret.env"
- cd "./build"
- sed -i "s/DOCKER_IMAGE_TAG/${CI_COMMIT_SHORT_SHA}/g" kustomization.yaml
- kubectl apply -k ./
- echo "Waiting for deployment..."
- sleep 30

View File

@ -73,7 +73,7 @@ spec:
tier: website
spec:
containers:
- image: registry.chaoticlogic.us/daniel-website:latest
- image: website-image
imagePullPolicy: Always
name: website
ports:

View File

@ -15,3 +15,7 @@ secretGenerator:
namespace: portfolio
envs:
- mysql-secret.env
images:
- name: website-image
newName: registry.chaoticlogic.us/daniel-website
newTag: DOCKER_IMAGE_TAG