Skip to content

Commit

Permalink
[fix] gitlab ssh-add failure, taking advice ros-industrial#756 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
130s committed Dec 28, 2022
1 parent b400979 commit 7bed5fb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ if [ -n "$SSH_PRIVATE_KEY" ]; then
# start SSH agent
# shellcheck disable=SC2046
eval $(ssh-agent -s)
# Avoiding https://github.com/ros-industrial/industrial_ci/issues/756
echo "${SSH_PRIVATE_KEY}" | tr -d ' ' | base64 --decode > private.ssh_key
chmod 600 private.ssh_key
# add key to agent
ssh-add <(echo "$SSH_PRIVATE_KEY" | base64 -d) || { res=$?; echo "could not add ssh key"; exit $res; }
ssh-add <private.ssh_key || { res=$?; echo "could not add ssh key"; exit $res; }

if [ -n "$SSH_SERVER_HOSTKEYS" ]; then
mkdir -p ~/.ssh
Expand Down

0 comments on commit 7bed5fb

Please sign in to comment.