diff --git a/ExerciseChecker/.gitlab-ci/01_functions.yml b/ExerciseChecker/.gitlab-ci/01_functions.yml index 2b482cb0d5285cb7bcca90b181b42033304c4d50..c173b18c0e4fd584ed9ed8cbb61d522d1634fc59 100644 --- a/ExerciseChecker/.gitlab-ci/01_functions.yml +++ b/ExerciseChecker/.gitlab-ci/01_functions.yml @@ -7,6 +7,7 @@ DOCKER_REGISTRY_USER=dojohessotest DOCKER_REGISTRY_IMAGE=dojohesso/test-dojo_exercise_checker DOCKER_REGISTRY_PASSWORD=$DOCKER_TEST_REGISTRY_PASSWORD + DOTENV_PROD_KEY=$DOTENV_TEST_KEY fi @@ -52,12 +53,11 @@ - cd $PROJECT_FOLDER - sed -i -r "s/\{\{VERSION\}\}/${VERSION}/g" src/app.ts - | - if [ $CI_COMMIT_REF_PROTECTED == "true" ]; then + if [ $CI_COMMIT_REF_PROTECTED == "true" || $CI_COMMIT_BRANCH == "test" ]; then echo "Decrypt production env vars" sed -i -r "s/(DOTENV_KEY[ ]*:[ ]*[\'\"\`])[^'\"\`]*([\'\"\`])([ ]*\,)?//g" src/app.ts sed -i -r "s/,[\ \n]*\}/\}/g" src/app.ts npx dotenv-vault local decrypt "${DOTENV_PROD_KEY}" > .env - fi - cd ..