diff --git a/generate-deploy-ops-stages.sh b/generate-deploy-ops-stages.sh new file mode 100644 index 0000000000000000000000000000000000000000..cebad55816b8c1c37421478e5a6a560a3c1872a3 --- /dev/null +++ b/generate-deploy-ops-stages.sh @@ -0,0 +1,24 @@ +set -ex +touch deploy.yml +echo "Running CI for ${TAG}" +if [[ ! -z "${TAG}" ]]; then + git clone --single-branch --branch ${TAG} https://github.com/MAAP-Project/maap-workspaces.git + pushd maap-workspaces + ls -d base_images/*/* > ${basedir}/images.txt + popd + cat ${basedir}/images.txt + template="${basedir}/deploy.yml.tmpl" + cat ${basedir}/images.txt | while read image + do + if [[ "$image" == base_images/*/* ]]; then + second_dir=$(echo "$image" | cut -d'/' -f2) + export BASE_IMAGE_TYPE=${second_dir} + export TAG=${TAG} + export DIT_REGISTRY=${DIT_REGISTRY} + cat ${template} | CI_JOB_TOKEN='$CI_JOB_TOKEN' envsubst >> deploy.yml + fi + done +fi + +echo "Generate stages.yaml" +cat deploy.yml || true