ci(gitlab-ci): fix bash syntax (ugh)

This commit is contained in:
Sarah Vaupel 2024-09-05 01:57:44 +02:00
parent 3fcdbdf7f2
commit f79a024dca

View File

@ -87,11 +87,9 @@ setup:containers:frontend:
- curl --request GET --header "PRIVATE-TOKEN:${REGISTRY_AUTH_TOKEN}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/registry/repositories?tags=true" > .gitlab-ci/.container-registry-contents.json
- IMAGE_EXISTS=`grep \""${REGISTRY_DESTINATION}"\" .gitlab-ci/.container-registry-contents.json`
- cat .gitlab-ci/.container-registry-contents.json
- echo ${IMAGE_EXISTS}
- echo ${CI_JOB_MANUAL}
- test ${CI_JOB_MANUAL} == true && echo "Force rebuilding container."
- test ${CI_JOB_MANUAL} = true && echo "Force rebuilding container."
- >
if [ ( -z ${IMAGE_EXISTS} ) -o ( ${CI_JOB_MANUAL} = true ) ] ; then
if [ -z ${IMAGE_EXISTS} -o ${CI_JOB_MANUAL} = true ] ; then
echo "Building image..."
buildah bud -t ${IMAGE_TAG} --build-arg PROJECT_DIR=${CI_PROJECT_DIR} --volume ${CI_PROJECT_DIR}:/tmp/${CI_PROJECT_DIR} --file docker/frontend/Dockerfile
buildah push --creds "${CI_REGISTRY_USER}:${CI_JOB_TOKEN}" ${IMAGE_TAG} ${REGISTRY_DESTINATION}