.gitlab-ci.yml 625 Bytes
Newer Older
Muddsair Sharif's avatar
Muddsair Sharif committed
1
2
3
image: ubuntu

before_script:
Sintal's avatar
Sintal committed
4
5
  - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  - eval $(ssh-agent -s)
Sintal's avatar
Sintal committed
6
  - echo "$SSH_PRIVATE_KEY" | base64 -d | tr -d '\r' | ssh-add - > /dev/null
Sintal's avatar
Sintal committed
7
8
9
10
  - mkdir -p ~/.ssh
  - chmod 700 ~/.ssh
  - ssh-keyscan bwunicluster.scc.kit.edu > ~/.ssh/known_hosts
  - chmod 644 ~/.ssh/known_hosts
Muddsair Sharif's avatar
Muddsair Sharif committed
11
12
13

Test SSH:
    script:
Sintal's avatar
Sintal committed
14
15
16
17
    - ssh $USER_NAME "mkdir -p testscript"
    - scp testscript.sh $USER_NAME:~/testscript/testscript.sh
    - scp helloworld.c $USER_NAME:~/testscript/helloworld.c
    - ssh $USER_NAME "cd ~/testscript && chmod 700 testscript.sh && ./testscript.sh"