diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8103b4c..62a7d47 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -70,6 +70,16 @@ preparation: dotenv: context.env .build-and-push-script: &build-and-push-script + - | + if [[ -z "${BUILD_ARG_PROD}" ]]; then + BUILD_ARG_PROD="x=x" + fi + if [[ -z "${BUILD_ARG_PROD_OTHER}" ]]; then + BUILD_ARG_PROD_OTHER="x=x" + fi + if [[ -z "${BUILD_ARG_TEST}" ]]; then + BUILD_ARG_TEST="x=x" + fi - docker build ${FOLDER} -f ${FOLDER}/Dockerfile.prod --build-arg "${BUILD_ARG_PROD}" --build-arg "${BUILD_ARG_PROD_OTHER}" -t ${PROD_IMAGE} - docker build ${FOLDER} -f ${FOLDER}/Dockerfile.test --build-arg "${BUILD_ARG_TEST}" -t ${TEST_IMAGE} - docker push ${PROD_IMAGE}