.gitlab-ci.yml 1.32 KB
Newer Older
Sintal's avatar
Sintal committed
1
2
image: ubuntu

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

Sintal's avatar
Sintal committed
15
16
Test SSH:
    script:
Naundorf's avatar
Naundorf committed
17
      - GITLAB_KEY=$(echo "$GITLAB_KEY" | tr -d '\r' | tr -d '\n')
Naundorf's avatar
Naundorf committed
18
19
20
      # - ssh -J ubuntu@193.196.53.93 $USER_NAME "mkdir -p test_dir"
      - ssh -J ubuntu@193.196.53.93 $USER_NAME "mkdir -p execute_vehicle_classification"
      # - scp -o "Proxyjump ubuntu@193.196.53.93" testscript.sh $USER_NAME:~/test_dir/testscript.sh
Naundorf's avatar
Naundorf committed
21
      - scp -o "Proxyjump ubuntu@193.196.53.93" execute_vehicle_classification.sh $USER_NAME:~/execute_vehicle_classification/execute_vehicle_classification.sh
Naundorf's avatar
Naundorf committed
22
23
      # - ssh -J ubuntu@193.196.53.93 $USER_NAME "chmod 700 test_dir/testscript.sh && sbatch -p single ./test_dir/testscript.sh $GITLAB_KEY"
      - ssh -J ubuntu@193.196.53.93 $USER_NAME "chmod 700 execute_vehicle_classification/execute_vehicle_classification.sh && ./execute_vehicle_classification/execute_vehicle_classification.sh $GITLAB_KEY"