forked from friends-of-forkcms/fork-cms-module-commerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathokteto-pipeline.yml
20 lines (18 loc) · 1.17 KB
/
okteto-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
icon: https://raw.githubusercontent.com/friends-of-forkcms/fork-cms-module-commerce/master/deploy/icon.png
deploy:
# Build & push docker image on okteto.com. Then override the container image tag with this one using kustomize
- |
IMAGE_TAG=$OKTETO_GIT_COMMIT
okteto build \
--build-arg THEME_NAME=CommerceDemo \
--cache-from ghcr.io/friends-of-forkcms/fork-cms-module-commerce:latest \
-t okteto.dev/fork-cms-module-commerce-demo:${IMAGE_TAG}
echo "Finished building docker image with tag ${IMAGE_TAG} for branch ${OKTETO_GIT_BRANCH}"
cd k8s && kustomize edit set image okteto.dev/fork-cms-module-commerce-demo=okteto.dev/fork-cms-module-commerce-demo:${IMAGE_TAG}
# Only reset the pod every 2 hours on master branch. For branches, clear the cronjob demo resetter.
- if [[ "$OKTETO_GIT_BRANCH" != "master" ]]; then echo "" > ./k8s/cronjob-demo-reset.yml; fi
# Deploy Kubernetes manifest using Kustomize.
# Use envsubst to replace env values in our k8s files, e.g. for injecting the SITE_DOMAIN.
- |
export SITE_DOMAIN="preview-module-commerce-${OKTETO_NAMESPACE}.cloud.okteto.net"
kustomize build ./k8s | envsubst | kubectl apply -f -