Skip to content

Commit

Permalink
Store private key as env variable and ssh-add
Browse files Browse the repository at this point in the history
- contents of ~/.ssh/gerrit in jenkins is now stored as an environment variable ID_RSA
  • Loading branch information
Athmika-HS committed Mar 28, 2022
1 parent 12b5528 commit b42915f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/docker-execute
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,17 @@ docker run --privileged=true -dit \
"$IMAGE_NAME" "${CONTAINER_ARGS[@]}"

#docker exec ${CONTAINER_NAME} bash -c 'echo $SSH_AUTH_SOCK'
echo "Docker exec:-"

#docker exec ${CONTAINER_NAME} bash -c 'chmod dependabot:dependabot /home/dependabot/dependabot-core/tmp';
docker exec -u 0 ${CONTAINER_NAME} bash -c 'ls -ald /home/dependabot/dependabot-core/tmp;
docker exec ${CONTAINER_NAME} bash -c 'ls -ald /home/dependabot/dependabot-core/tmp;
ls -ald /home/dependabot/dependabot-core;
echo "UID: $(id -u)"
echo "GID: $(id -g)"
whoami;
ls -la /home/dependabot/.ssh;
eval $(ssh-agent -s);
ssh-add $PRIV_KEY;
ssh-add /home/dependabot/.ssh/$(echo $(cat /home/dependabot/.ssh/config | grep IdentityFile) | cut -d " " -f 2 | cut -d "/" -f 3);
for c in $(ssh -p 29418 -o "StrictHostKeyChecking no" jenkins@gerrit.helpshift.com gerrit query --current-patch-set project:${REPO_NAME} branch:feature/dependabot | grep revision | tr -s " " | cut -d " " -f 3); \
Expand Down

0 comments on commit b42915f

Please sign in to comment.