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

CI/CD => Add decrypt en vars & set version of cli

parent 9668ab1b
No related branches found
No related tags found
1 merge request!2Adds a first version of the wiki documentation
Pipeline #26407 failed
...@@ -74,6 +74,19 @@ variables: ...@@ -74,6 +74,19 @@ variables:
# Install dependencies # Install dependencies
- npm install - npm install
# Set version number shown in CLI
- sed -r "s/(\.version[ ]*\([ ]*\').*(\'[ ]*\))/\1${VERSION}\2/g" src/commander/CommanderApp.ts > src/commander/CommanderApp.ts
# Decrypt env vars for production
- |
if [ $CI_COMMIT_REF_PROTECTED == "true" ]; then
echo "Decrypt production env vars"
sed -r "s/(\,(\n)?[]+)?(DOTENV_KEY[ ]*:[ ]*[\'\"\`])[^'\"\`]*([\'\"\`])//g" src/app.ts > src/app.ts;
npx dotenv-vault local decrypt "${DOTENV_PROD_KEY}" > .env
fi
# Build
- npm run build - npm run build
# Build binaries # Build binaries
...@@ -168,10 +181,6 @@ build:version: ...@@ -168,10 +181,6 @@ build:version:
- mkdir -p $ARTIFACTS_FOLDER - mkdir -p $ARTIFACTS_FOLDER
- echo $VERSION > $VERSION_FILE - echo $VERSION > $VERSION_FILE
- |
echo "Replace DOTENV_KEY if we are on a protected branch" # Hide the print of the DOTENV_PROD_KEY
sed -r "s/(DOTENV_KEY[ ]*:[ ]*[\'\"\`])[^'\"\`]*([\'\"\`])/\${DOTENV_PROD_KEY}\2/g" ${PROJECT_FOLDER}/src/app.ts > ${PROJECT_FOLDER}/src/app.ts;
# Build # Build
- !reference [.build_cli, script] - !reference [.build_cli, script]
artifacts: artifacts:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment