Skip to content

Commit

Permalink
Provide permissions to modify dependabot-core directory
Browse files Browse the repository at this point in the history
- The dependaot user in jenkins currently cannot create directories
inside tmp
- Provide access to create directories inside all of dependabot-core
  • Loading branch information
Athmika-HS committed Mar 17, 2022
1 parent 4dc09d7 commit c121e69
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 85 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ vendor
coverage/
.ruby-gemset
.ruby-version
/.ssh
11 changes: 8 additions & 3 deletions bin/docker-execute
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ docker run -dit \
-v "$(pwd)/omnibus/lib:$CODE_DIR/omnibus/lib" \
-v "$(pwd)/omnibus/spec:$CODE_DIR/omnibus/spec" \
-v "$(pwd)/omnibus/script:$CODE_DIR/omnibus/script" \
-v "$(pwd)/tmp:/$CODE_DIR/tmp" \
-v "${HOME}/.ssh:/home/dependabot/.ssh" \
-v "$(pwd)/tmp:/$CODE_DIR/tmp" \
--name "$CONTAINER_NAME" \
-e SSH_AUTH_SOCK=$SSH_AUTH_SOCK \
-e PACKAGE_NAME=$PACKAGE_NAME \
Expand All @@ -233,7 +232,13 @@ docker run -dit \
"$IMAGE_NAME" "${CONTAINER_ARGS[@]}"

#docker exec ${CONTAINER_NAME} bash -c 'echo $SSH_AUTH_SOCK'
docker exec ${CONTAINER_NAME} bash -c 'eval $(ssh-agent);

#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;
ls -ald /home/dependabot/dependabot-core;
whoami;
chmod 777 /home/dependabot/dependabot-core;
eval $(ssh-agent);
for c in $(ssh -p 29418 [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; \
Expand Down
4 changes: 2 additions & 2 deletions bin/dry-run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,13 @@ def handle_dependabot_error(error:, dependency:)

# checkout to feature branch so that all commits are made in this branch.
Dir.chdir($repo_contents_path) do


system("git checkout -b feature/dependabot")
system("git merge --no-ff --no-commit origin/master")
system("mkdir .github")
# system("git commit -m ")

end

# Dir.chdir("tmp/aadhar/.github") do
Expand Down
2 changes: 1 addition & 1 deletion common/lib/dependabot/file_fetchers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def _clone_repo_contents(target_directory:)
br_opt = " --branch #{source.branch} --single-branch" if source.branch
SharedHelpers.run_shell_command(
<<~CMD
git clone --no-tags ssh://gerrit/#{source.repo}.git #{path}
git clone --no-tags ssh://gerrit.helpshift.com/#{source.repo}.git #{path}
CMD
)
Expand Down
17 changes: 0 additions & 17 deletions ssh/config

This file was deleted.

39 changes: 0 additions & 39 deletions ssh/id_rsa

This file was deleted.

1 change: 0 additions & 1 deletion ssh/id_rsa.pub

This file was deleted.

10 changes: 0 additions & 10 deletions ssh/known_hosts

This file was deleted.

3 changes: 0 additions & 3 deletions ssh/known_hosts.old

This file was deleted.

8 changes: 0 additions & 8 deletions ssh/podman-machine-default

This file was deleted.

1 change: 0 additions & 1 deletion ssh/podman-machine-default.pub

This file was deleted.

0 comments on commit c121e69

Please sign in to comment.