Update .gitlab-ci.yml

This commit is contained in:
Santiago Lo Coco 2023-12-01 14:25:14 -03:00
parent 469fc4734b
commit 1380fbccbe
1 changed files with 4 additions and 12 deletions

View File

@ -14,6 +14,8 @@ default:
- api_failure - api_failure
before_script: before_script:
- docker login -u $CI_REGISTRY_USER --password $CI_JOB_TOKEN $CI_REGISTRY - docker login -u $CI_REGISTRY_USER --password $CI_JOB_TOKEN $CI_REGISTRY
artifacts:
expire_in: 1 week
stages: stages:
- prep - prep
@ -70,18 +72,8 @@ preparation:
dotenv: context.env dotenv: context.env
.build-and-push-script: &build-and-push-script .build-and-push-script: &build-and-push-script
- | - docker build ${FOLDER} -f ${FOLDER}/Dockerfile.prod --build-arg "${BUILD_ARG_PROD-x}" --build-arg "${BUILD_ARG_PROD_OTHER-x}" -t ${PROD_IMAGE}
if [[ -z "${BUILD_ARG_PROD}" ]]; then - docker build ${FOLDER} -f ${FOLDER}/Dockerfile.test -t ${TEST_IMAGE}
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} - docker push ${PROD_IMAGE}
- docker push ${TEST_IMAGE} - docker push ${TEST_IMAGE}