Commit 56878081 authored by Dainius Simelevicius's avatar Dainius Simelevicius
Browse files

references #151: configuring ssh before 'staging' and 'production' jobs

parent 85ef6a13
...@@ -608,7 +608,20 @@ deploy: ...@@ -608,7 +608,20 @@ deploy:
except: except:
- pushes - pushes
.ssh_init:
before_script:
- which ssh-agent
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- ssh-add -l
- echo "Host gitlab.cern.ch" > ~/.ssh/config
- echo " HostName gitlab.cern.ch" >> ~/.ssh/config
- echo " UserKnownHostsFile /dev/null" >> ~/.ssh/config
- echo " StrictHostKeyChecking=no" >> ~/.ssh/config
- cat ~/.ssh/config
git: git:
extends: .ssh_init
stage: distribute stage: distribute
dependencies: dependencies:
- all - all
...@@ -705,16 +718,6 @@ git: ...@@ -705,16 +718,6 @@ git:
- elastic/api - elastic/api
- elastic/timestream - elastic/timestream
- amc13controller - amc13controller
before_script:
- which ssh-agent
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- ssh-add -l
- echo "Host gitlab.cern.ch" > ~/.ssh/config
- echo " HostName gitlab.cern.ch" >> ~/.ssh/config
- echo " UserKnownHostsFile /dev/null" >> ~/.ssh/config
- echo " StrictHostKeyChecking=no" >> ~/.ssh/config
- cat ~/.ssh/config
script: script:
- export RELEASE_NUMBER=$(echo $CI_COMMIT_REF_NAME | awk '{split($0,a,"_"); print a[2]}') - export RELEASE_NUMBER=$(echo $CI_COMMIT_REF_NAME | awk '{split($0,a,"_"); print a[2]}')
- export SNAPSHOT_DIR=$RPM_REPO_DIR/$RELEASE_NUMBER/cc7/x86_64/RPMS/ - export SNAPSHOT_DIR=$RPM_REPO_DIR/$RELEASE_NUMBER/cc7/x86_64/RPMS/
...@@ -898,9 +901,11 @@ yum: ...@@ -898,9 +901,11 @@ yum:
- pushes - pushes
staging: staging:
extends: .ssh_init
stage: staging stage: staging
<<: *release_definition <<: *release_definition
production: production:
extends: .ssh_init
stage: production stage: production
<<: *release_definition <<: *release_definition
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment