Created
November 9, 2022 20:10
-
-
Save infamousjoeg/7b6eb2c51540b1f982f7700bcf0100b0 to your computer and use it in GitHub Desktop.
How to use Conjur Secrets provided SSH Private Key to clone Git repository in Jenkins
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
set +x | |
echo "$CONJUR_SECRET" > "$WORKSPACE"/private.key | |
set -x | |
chmod 0600 "$WORKSPACE"/private.key | |
sed -i 's/\r$//g' "$WORKSPACE"/private.key | |
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i $WORKSPACE/private.key -F /dev/null" | |
git clone git@github.com:infamousjoeg/epa-poc.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment