From e41905571b1b8268fe469c18521b42149331fb07 Mon Sep 17 00:00:00 2001 From: Jashandeep Sohi Date: Mon, 8 Jan 2024 11:32:57 -0800 Subject: [PATCH] add prod cd update scripts --- cd.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/cd.nix b/cd.nix index a9a990a..57077b8 100644 --- a/cd.nix +++ b/cd.nix @@ -26,6 +26,13 @@ popd ''; + scripts.kustomize-build-prod.exec = '' + set -xe + pushd $DEVENV_ROOT + kustomize build prod/ --output output/prod/manifest.yaml + popd + ''; + scripts.cd-update-staging.exec = '' set -ex @@ -39,6 +46,8 @@ exit 1 fi + pushd $DEVENV_ROOT + pushd staging/ kpt pkg update base@$2 @@ -51,6 +60,24 @@ popd kustomize build staging/ --output output/staging/manifest.yaml + popd + ''; + + scripts.cd-update-prod.exec = '' + set -ex + + if test -z "$1"; then + echo "first argument should be git commit hash of staging" + exit 1 + fi + + pushd $DEVENV_ROOT + + kpt pkg update prod/base@$2 + kpt pkg update prod/cd-set-images@$2 + + kustomize build prod/ --output output/prod/manifest.yaml + popd ''; }; }