Skip to content

Commit 032103f

Browse files
committed
(azure) use ssh
1 parent e9dd7bf commit 032103f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

azure-pipelines.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,29 @@ stages:
9696
source ./set-branch.sh --branch=${SYSTEM_PULLREQUEST_TARGETBRANCH:-${BUILD_SOURCEBRANCH#refs/heads/}}
9797
echo "##vso[task.setvariable variable=BRANCH]$BRANCH"
9898
condition: and(succeeded(), not(canceled()))
99+
- task: DownloadSecureFile@1
100+
name: deployKey
101+
displayName: 'Download Deploy Key'
102+
inputs:
103+
secureFile: deploy_key
104+
condition: and(succeeded(), not(canceled()))
99105
- task: Bash@3
100106
displayName: Install
107+
env:
108+
SSH_KNOWN_HOSTS: "github.com"
101109
inputs:
102110
targetType: inline
103111
script: |
112+
mkdir -p "${HOME}"/.ssh
113+
cp $(deployKey.secureFilePath) "${HOME}"/.ssh/ci_ssh_key
114+
if [[ -n "${SSH_KNOWN_HOSTS}" ]]
115+
then
116+
for host in ${SSH_KNOWN_HOSTS}
117+
do
118+
echo -e "\e[35m\e[1mssh-keyscan -t rsa -H \"${host}\" 2>&1 | tee -a ${HOME}/.ssh/known_hosts\e[0m"
119+
ssh-keyscan -t rsa -H "${host}" 2>&1 | tee -a "${HOME}"/.ssh/known_hosts
120+
done
121+
fi
104122
bash install-package.sh --package=${PACKAGE} --branch=${BRANCH} --commit=${BUILD_SOURCEVERSION} --pullrequest=${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER:-false} --image="ghcr.io/tue-robotics/tue-env-ros-noetic"
105123
condition: and(succeeded(), not(canceled()))
106124
- task: Bash@3

0 commit comments

Comments
 (0)