brixzen/ssh-client

By brixzen

Updated over 2 years ago

Simple SSH client that have SCP and SSH please echo to /root/.ssh/id_rsa for default key

Image

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 Command

docker pull brixzen/ssh-client