Skip to content
Snippets Groups Projects
Commit cc984986 authored by michael.minelli's avatar michael.minelli
Browse files

CI/CD => dotenv for test

parent b3763550
No related branches found
No related tags found
No related merge requests found
Pipeline #26970 passed
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
DOCKER_REGISTRY_USER=dojohessotest DOCKER_REGISTRY_USER=dojohessotest
DOCKER_REGISTRY_IMAGE=dojohesso/test-dojo_exercise_checker DOCKER_REGISTRY_IMAGE=dojohesso/test-dojo_exercise_checker
DOCKER_REGISTRY_PASSWORD=$DOCKER_TEST_REGISTRY_PASSWORD DOCKER_REGISTRY_PASSWORD=$DOCKER_TEST_REGISTRY_PASSWORD
DOTENV_PROD_KEY=$DOTENV_TEST_KEY
fi fi
...@@ -52,12 +53,11 @@ ...@@ -52,12 +53,11 @@
- cd $PROJECT_FOLDER - cd $PROJECT_FOLDER
- sed -i -r "s/\{\{VERSION\}\}/${VERSION}/g" src/app.ts - 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" echo "Decrypt production env vars"
sed -i -r "s/(DOTENV_KEY[ ]*:[ ]*[\'\"\`])[^'\"\`]*([\'\"\`])([ ]*\,)?//g" src/app.ts sed -i -r "s/(DOTENV_KEY[ ]*:[ ]*[\'\"\`])[^'\"\`]*([\'\"\`])([ ]*\,)?//g" src/app.ts
sed -i -r "s/,[\ \n]*\}/\}/g" src/app.ts sed -i -r "s/,[\ \n]*\}/\}/g" src/app.ts
npx dotenv-vault local decrypt "${DOTENV_PROD_KEY}" > .env npx dotenv-vault local decrypt "${DOTENV_PROD_KEY}" > .env
fi fi
- cd .. - cd ..
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment