Skip to content

Commit

Permalink
Add /opt/java/openjdk/bin to sudo secure_path in jenkins-agent-dind
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Dec 18, 2024
1 parent ff1d332 commit c189188
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jenkins-agent-dind/scripts/prepare_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ paths:
- /
- '${AGENT_WORKDIR}'
EOF

# Add /opt/java/openjdk/bin to sudo secure_path
default_secure_path=$(
sudo cat /etc/sudoers | grep -oP 'Defaults\s+secure_path="[^"]+"' | cut -d'"' -f2
)
echo "Defaults secure_path=\"${default_secure_path}:/opt/java/openjdk/bin\"" |
sudo tee /etc/sudoers.d/secure_path

0 comments on commit c189188

Please sign in to comment.