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

Add template to deploy custom images

parent 5fdfa1ee
No related branches found
No related tags found
No related merge requests found
Pipeline #2808 passed with stages
in 2 seconds
${CUSTOM_IMAGE_TYPE}:
script:
- docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" $CI_REGISTRY
- docker pull $DIT_REGISTRY/custom_images/${CUSTOM_IMAGE_TYPE}:main
- docker tag $DIT_REGISTRY/custom_images/${CUSTOM_IMAGE_TYPE}:main $CI_REGISTRY/root/maap-workspaces/custom_images/${CUSTOM_IMAGE_TYPE}:${TAG}
- docker push $CI_REGISTRY/root/maap-workspaces/custom_images/${CUSTOM_IMAGE_TYPE}:${TAG}
tags:
- shell
......@@ -11,17 +11,26 @@ 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
ls -d custom_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
template="${basedir}/deploy.yml.tmpl"
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
elif [[ "$image" == custom_images/*/* ]]; then
template="${basedir}/deploy_custom_images.yml.tmpl"
second_dir=$(echo "$image" | cut -d'/' -f2)
export CUSTOM_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
......
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