-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mount only the .ssh directory and do no copy contents of RSA key
- Remove code that copied the keys in another file called id_rsa - Since the current host user is the user inside docker now, there should be no permission issues to read the SSH key and add the keys to the agent.
- Loading branch information
Showing
1 changed file
with
1 addition
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ echo "package: $2" | |
echo "Image: $IMAGE_NAME" | ||
echo "UID: $(id -u)" | ||
echo "GID: $(id -g)" | ||
rm -rf $(pwd)/id_rsa | ||
|
||
cat ~/.ssh/gerrit > $(pwd)/id_rsa | ||
# Enable docker buildkit with inline cache builds | ||
export DOCKER_BUILDKIT=1 | ||
|
@@ -233,7 +233,6 @@ docker run --privileged=true -dit \ | |
-v "$(pwd)/omnibus/script:$CODE_DIR/omnibus/script" \ | ||
-v "$(pwd)/tmp:$CODE_DIR/tmp" \ | ||
-v "${HOME}/.ssh:/home/dependabot/.ssh:ro" \ | ||
-v "$(pwd)/id_rsa:$CODE_DIR/id_rsa" \ | ||
--name "$CONTAINER_NAME" \ | ||
-e SSH_AUTH_SOCK=$SSH_AUTH_SOCK \ | ||
-e PACKAGE_NAME=$PACKAGE_NAME \ | ||
|
@@ -254,8 +253,6 @@ echo "UID: $(id -u)" | |
echo "GID: $(id -g)" | ||
whoami; | ||
eval $(ssh-agent -s); | ||
ssh-add /home/dependabot/dependabot-core/id_rsa; | ||
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" [email protected] gerrit query --current-patch-set project:${REPO_NAME} branch:feature/dependabot | grep revision | tr -s " " | cut -d " " -f 3); \ | ||
do ssh -p 29418 [email protected] gerrit review $c --abandon; \ | ||
|