From 1ebd28b41e5d36076b8862e9f818b2417534fcae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20T=C3=B3th?= <tothmiklostibor@gmail.com> Date: Mon, 8 Mar 2021 20:16:06 +0100 Subject: [PATCH] ci/cd --- .gitlab-ci.yml | 21 +++++++++++++++++++++ .magic_ssh_config | 7 +++++++ 2 files changed, 28 insertions(+) create mode 100644 .magic_ssh_config diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e69de29..2c931f1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -0,0 +1,21 @@ +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 \ No newline at end of file diff --git a/.magic_ssh_config b/.magic_ssh_config new file mode 100644 index 0000000..72ebfe2 --- /dev/null +++ b/.magic_ssh_config @@ -0,0 +1,7 @@ +Host centaur.sch.bme.hu + StrictHostKeyChecking no + ControlMaster auto + ControlPersist yes + ControlPath ~/.ssh/socket/%r@%h:%p + RequestTTY yes + SecurityKeyProvider internal \ No newline at end of file -- GitLab