From 1e5c786841c562215fc3216bfe84a8f153f5f429 Mon Sep 17 00:00:00 2001 From: Drew Reed Date: Tue, 10 Jan 2023 16:12:15 +0000 Subject: [PATCH] ci: Fix ssh key inclusion logic The logic used to only try and add the SSH keys for both the gitlab and gerrit servers is corrected to only try adding the keys when they are set in the environment. Signed-off-by: Drew Reed --- .gitlab/ci/cassini-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/cassini-build.yml b/.gitlab/ci/cassini-build.yml index 50a2199..6190f4f 100644 --- a/.gitlab/ci/cassini-build.yml +++ b/.gitlab/ci/cassini-build.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Arm Limited or its affiliates. All rights reserved. +# Copyright (c) 2022-2023 Arm Limited or its affiliates. All rights reserved. # # SPDX-License-Identifier: MIT --- @@ -27,7 +27,7 @@ before_script: - mkdir -p ~/.ssh - eval "$(ssh-agent -s)" - - if [ -z "${SSH_PRIVATE_GITLAB}+x" ]; then + - if [ -n "${SSH_PRIVATE_GITLAB+x}" ]; then echo "${SSH_PRIVATE_GITLAB}" | tr -d '\r' | ssh-add - > /dev/null; fi - ssh-keyscan -t rsa ${CI_SERVER_HOST} >> ~/.ssh/known_hosts -- GitLab