update: jenkinsfile code for multibranch pipeline
This commit is contained in:
parent
f0f871369f
commit
859b0ce173
|
|
@ -80,8 +80,14 @@ pipeline {
|
|||
dir("${MANIFEST_DIR}-${overlayEnv}") {
|
||||
sh """
|
||||
set -e
|
||||
echo "Cleaning up overlays folder to only keep ${overlayEnv}"
|
||||
find overlays -mindepth 1 -maxdepth 1 -type d ! -name "${overlayEnv}" -exec rm -rf {} +
|
||||
echo "🧹 Cleaning overlays folder, keeping only ${overlayEnv}..."
|
||||
for d in overlays/*; do
|
||||
[ -d "$d" ] || continue
|
||||
if [ "$(basename "$d")" != "${overlayEnv}" ]; then
|
||||
echo "Removing $d"
|
||||
rm -rf "$d"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Updating image tags for ${overlayEnv}..."
|
||||
yq e -i '(.spec.template.spec.containers[] | select(.name == "backend") | .image) = "${REGISTRY}/${APP_NAME}-be:${overlayEnv}-${env.IMAGE_TAG_FINAL}"' overlays/${overlayEnv}/patch-deployment.yaml
|
||||
|
|
|
|||
Loading…
Reference in New Issue