Gitlab will migrate to a new storage backend starting 0300 UTC on 2020-04-04. We do not anticipate a maintenance window for this migration. Performance may be impacted over the weekend. Thanks for your patience.

ssh.yml 922 Bytes
Newer Older
Leo Pound Singer's avatar
Leo Pound Singer committed
1 2 3 4 5 6
# Execute remote commands on LIGO Data Grid clusters.
# Place your base64-encoded conents of your Kerberos keytab in a
# protected CI variable called ROBOT_KEYTAB.

.ssh: &ssh
  image:
7
    name: igwn/ssh
Leo Pound Singer's avatar
Leo Pound Singer committed
8 9 10 11 12 13 14 15 16 17 18
    entrypoint: [""]
  before_script:
    # Decode base64-encoded keytab
    - echo "${ROBOT_KEYTAB}" | base64 -d | install -m 0600 /dev/stdin keytab
    # Read principal from first entry in keytab
    - PRINCIPAL=$(klist -k keytab | head -n 4 | tail -n 1 | sed -E 's/^.* +//')
    # Create X.509 certificate
    - kinit $PRINCIPAL -k -t keytab
    - rm keytab
    - ligo-proxy-init -k -p
    - grid-proxy-info -identity
Leo Pound Singer's avatar
Leo Pound Singer committed
19
    # Configure gsissh: default port and usernames
Leo Pound Singer's avatar
Leo Pound Singer committed
20
    - mkdir -p ~/.ssh
Leo Pound Singer's avatar
Leo Pound Singer committed
21 22 23 24 25
    - |
      cat > ~/.ssh/config <<EOF
      Port 2222
      Host emfollow-playground.*
      User emfollow-playground
Leo Pound Singer's avatar
Leo Pound Singer committed
26 27
      Host emfollow-test.*
      User emfollow-test
Leo Pound Singer's avatar
Leo Pound Singer committed
28 29 30
      Host emfollow.*
      User emfollow
      EOF