brixzen/ssh-client
Simple SSH client that have SCP and SSH please echo to /root/.ssh/id_rsa for default key
23
Need to setup variable in gitlab CI/CD
SSH_PRIVATE_KEY_STAGING:privateKeyString
HOSTNAME_STAGING:hostnameOfServer
Please add this to .gitlab-ci.yml at deploy stage :
deploy-build:
image: brixzen/ssh-client:1.0.0
stage: deploy
only:
- master
environment:
name: staging
url: $HOSTNAME_STAGING
script:
- echo "$SSH_PRIVATE_KEY_STAGING" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- scp -r target/*-runner $HOSTNAME_STAGING:/app/bin/
- ssh root@$HOSTNAME_STAGING '/app/patch.sh'
docker pull brixzen/ssh-client