image: ubuntu

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
  - ssh-keyscan bwunicluster.scc.kit.edu > ~/.ssh/known_hosts
  - chmod 644 ~/.ssh/known_hosts
#
Test SSH:
    script:
      - GITLAB_KEY=$(echo "$GITLAB_KEY" | tr -d '\r' | tr -d '\n')
      - ssh $USER_NAME "mkdir -p execute_vehicle_classification"
      - scp execute_vehicle_classification.sh $USER_NAME:~/execute_vehicle_classification/execute_vehicle_classification.sh
      - ssh $USER_NAME "chmod 700 execute_vehicle_classification/execute_vehicle_classification.sh && ./execute_vehicle_classification/execute_vehicle_classification.sh $GITLAB_KEY"
