From 1cb34cb67f4aff48c619e30a99e612e88e09bc40 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 21 2020 15:09:18 +0000 Subject: Use an environment variable to distinguish prod from staging Using this environment variable we're able to get the ssh fingerprint from either prod or staging and log in kerberos to the correct server. Signed-off-by: Pierre-Yves Chibon --- diff --git a/entrypoint.sh b/entrypoint.sh index ff57bbb..4c4f6a7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,6 +7,16 @@ if ! whoami &> /dev/null; then fi ln -s /opt/ssh/id_rsa /.ssh/id_rsa || true +if [ -z ${PRODUCTION+x} ]; then +# Staging info +echo "Running in staging" kinit monitor-gating/os-master01.stg.phx2.fedoraproject.org@STG.FEDORAPROJECT.ORG -kt /etc/keytabs/koji-keytab ssh-keyscan pkgs.stg.fedoraproject.org >> /.ssh/known_hosts +else +# Prod info +echo "Running in production" +kinit monitor-gating/os-master01.phx2.fedoraproject.org@FEDORAPROJECT.ORG -kt /etc/keytabs/koji-keytab +ssh-keyscan pkgs.fedoraproject.org >> /.ssh/known_hosts +fi + python3 /opt/code/runner.py /opt/config/runner.cfg