Skip to content
Snippets Groups Projects
Commit 6cdafa58 authored by marcoemi.poleggi's avatar marcoemi.poleggi
Browse files

CI/CD Pipeline: move before_script inside a default block

parent 6f5cca70
No related branches found
No related tags found
No related merge requests found
......@@ -11,19 +11,20 @@ stages:
- test
- deploy
# Commmon to all stages -- needed because the image's storage is not persistent across them
before_script:
# uncomment for debugging. Watch out! It *will* expose any secret passed from an unprotected variable.
# - export
- apk -U add git openssh-client rsync
- mkdir -p -m 0700 ~/.ssh
- touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
- git config --global user.email "deployer@ci-cd.lab"
- git config --global user.name "The Deployer"
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
default:
# Commmon to all stages -- needed because the image's storage is not persistent across them
before_script:
# uncomment for debugging. Watch out! It *will* expose any secret passed from an unprotected variable.
# - export
- apk -U add git openssh-client rsync
- mkdir -p -m 0700 ~/.ssh
- touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" >> ~/.ssh/config'
- git config --global user.email "deployer@ci-cd.lab"
- git config --global user.name "The Deployer"
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
unit_test1:
stage: test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment