Skip to content
Snippets Groups Projects
Commit d949e79f authored by Administrator's avatar Administrator
Browse files

Update generate-deploy-stages.sh

parent 34cfc7b1
No related branches found
No related tags found
No related merge requests found
Pipeline #1762 failed with stages
in 1 second
......@@ -2,18 +2,23 @@
set -e
basedir=$( cd "$(dirname "$0")" ; pwd -P )
cat $TRIGGER_PAYLOAD | python3 -c "import sys, json; print(json.loads(json.load(sys.stdin)['payload'])['ref'])" | grep "-uat"
cat $TRIGGER_PAYLOAD
cat $TRIGGER_PAYLOAD | python3 -c "import sys, json; print(json.loads(json.load(sys.stdin)['payload'])['ref'])" | grep "uat"
TAG=$(!!)
git clone --single-branch --branch ${TAG} https://github.com/MAAP-Project/maap-workspaces.git
pushd maap-workspaces
find base_images -type d -depth 1 > ${basedir}/images.txt
cat ${basedir}/images.txt
template="${basedir}/deploy.yml.tmpl"
cat ${basedir}/images.txt | while read image
do
export BASE_IMAGE_TYPE=$(basename ${image})
export TAG=${TAG}
cat ${template} | CI_JOB_TOKEN='$CI_JOB_TOKEN' CI_REGISTRY='$CI_REGISTRY' envsubst >> deploy.yml
done
touch deploy.yml
if [ -z "${TAG}" ]; then
git clone --single-branch --branch ${TAG} https://github.com/MAAP-Project/maap-workspaces.git
pushd maap-workspaces
find base_images -type d -depth 1 > ${basedir}/images.txt
cat ${basedir}/images.txt
template="${basedir}/deploy.yml.tmpl"
cat ${basedir}/images.txt | while read image
do
export BASE_IMAGE_TYPE=$(basename ${image})
export TAG=${TAG}
cat ${template} | CI_JOB_TOKEN='$CI_JOB_TOKEN' CI_REGISTRY='$CI_REGISTRY' envsubst >> deploy.yml
done
fi
echo "Generate stages.yaml"
cat deploy.yml || true
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