image: kroniak/ssh-client

stages:
  - deploy

home:
  stage: deploy
  before_script:
    - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
    - eval $(ssh-agent -s)
    - echo "$SSH" | tr -d '\r' | ssh-add -
    - mkdir -p ~/.ssh/socket
    - chmod 700 ~/.ssh
    - cp .magic_ssh_config ~/.ssh/config
  script:
    - ssh mikewashere@centaur.sch.bme.hu "cp /afs/sch.bme.hu/home/mikewashere/.system/mikewashere.keytab /tmp/; kinit -k -t /tmp/mikewashere.keytab mikewashere; rm /tmp/mikewashere.keytab; aklog sch.bme.hu -k SCH.BME.HU"
    - ssh mikewashere@centaur.sch.bme.hu mkdir -p ~/public_html/linux
    - scp -R . mikewashere@centaur.sch.bme.hu:~/public_html/linux/.
  only:
    refs:
      - master