Verified Commit 8c40f72f authored by justin's avatar justin
Browse files

Build and push tagged commits to their tag.

parent 3c1fe593
Pipeline #354 passed with stages
in 4 minutes and 31 seconds
......@@ -45,6 +45,7 @@ build-frontend:
- /kaniko/executor build --cache=true --dockerfile=$PROJECT_DIR/frontend/Dockerfile --context $PROJECT_DIR/frontend --no-push --cache-repo $CONTAINER_REGISTRY/frontend/cache
except:
- master
- tags
build-backend:
stage: build
......@@ -55,6 +56,7 @@ build-backend:
- /kaniko/executor build --cache=true --dockerfile=$PROJECT_DIR/backend/Dockerfile --context $PROJECT_DIR/backend --no-push --cache-repo $CONTAINER_REGISTRY/backend/cache
except:
- master
- tags
# For master builds, push the commit and update the :latest tag.
......@@ -78,6 +80,28 @@ build-backend-master:
only:
- master
# For tags, push the commit and update the provided tag
build-frontend-tag:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- /kaniko/executor build --cache=true --dockerfile=$PROJECT_DIR/frontend/Dockerfile --destination=$CONTAINER_REGISTRY/frontend:$CI_COMMIT_SHA --destination=$CONTAINER_REGISTRY/frontend:$CI_COMMIT_REF_SLUG --context $PROJECT_DIR/frontend
only:
- tags
build-backend-tag:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- /kaniko/executor build --cache=true --dockerfile=$PROJECT_DIR/backend/Dockerfile --destination=$CONTAINER_REGISTRY/backend:$CI_COMMIT_SHA --destination=$CONTAINER_REGISTRY/backend:$CI_COMMIT_REF_SLUG --context $PROJECT_DIR/backend
only:
- tags
# Deploy every master commit
deploy-helm:
stage: deploy
image: lachlanevenson/k8s-helm
......@@ -87,7 +111,7 @@ deploy-helm:
- helm upgrade --install --namespace $KUBERNETES_NAMESPACE boxomon-backend --values $PROJECT_DIR/deploy/helm-upgrade/backend-values.yaml --set image.tag=$CI_COMMIT_SHA $PROJECT_DIR/deploy/boxomon-charts/backend
only:
- master
deploy-kubectl:
stage: deploy
image: lachlanevenson/k8s-kubectl
......@@ -95,3 +119,4 @@ deploy-kubectl:
- kubectl apply -f $PROJECT_DIR/deploy/kubectl-apply/
only:
- master
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment