From 4c61f7a476ff94b2302439fdc463b6113a7fa14e Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Fri, 26 Feb 2021 11:36:06 -0500 Subject: [PATCH] jjb: lttng-www: use jenkins credentials to populate known_hosts ssh This ensure that we deploy to the good host. Signed-off-by: Jonathan Rajotte --- jobs/lttng-www.yaml | 3 +++ scripts/lttng-www/deploy.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/jobs/lttng-www.yaml b/jobs/lttng-www.yaml index 3df2460..051b94d 100644 --- a/jobs/lttng-www.yaml +++ b/jobs/lttng-www.yaml @@ -18,6 +18,9 @@ key-file-variable: KEY_FILE_VARIABLE username-variable: USER_NAME_VARIABLE passphrase-variable: PASSPHRASE_VARIABLE + - file: + credential-id: d023f830-9ab0-409f-b977-8cd0e1944dd5 + variable: HOST_PUBLIC_KEYS triggers: - timed: '@daily' diff --git a/scripts/lttng-www/deploy.sh b/scripts/lttng-www/deploy.sh index 55f2958..9224b4e 100755 --- a/scripts/lttng-www/deploy.sh +++ b/scripts/lttng-www/deploy.sh @@ -19,7 +19,7 @@ set -exu # Add ssh key for deployment -echo "StrictHostKeyChecking no" >> ~/.ssh/config +cp "$HOST_PUBLIC_KEYS" ~/.ssh/known_hosts cp "$KEY_FILE_VARIABLE" ~/.ssh/id_rsa # lttng-www dependencies -- 2.34.1