Skip to content

Commit

Permalink
Run the bash commands inside container as root
Browse files Browse the repository at this point in the history
- Add -u flag and set value to 0 so that commands are run a root user.
  • Loading branch information
Athmika-HS committed Mar 28, 2022
1 parent 8ffe2b5 commit 12b5528
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bin/docker-execute
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,14 @@ docker run --privileged=true -dit \
#docker exec ${CONTAINER_NAME} bash -c 'echo $SSH_AUTH_SOCK'

#docker exec ${CONTAINER_NAME} bash -c 'chmod dependabot:dependabot /home/dependabot/dependabot-core/tmp';
docker exec ${CONTAINER_NAME} bash -c 'ls -ald /home/dependabot/dependabot-core/tmp;
docker exec -u 0 ${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 /home/dependabot/.ssh/$(echo $(cat /home/dependabot/.ssh/config | grep IdentityFile) | cut -d " " -f 2 | cut -d "/" -f 3);
ssh -vv -p 29418 jenkins@gerrit.helpshift.com;
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); \
do ssh -p 29418 jenkins@gerrit.helpshift.com gerrit review $c --abandon; \
Expand Down

0 comments on commit 12b5528

Please sign in to comment.