Skip to content

Instantly share code, notes, and snippets.

@infamousjoeg
Created November 9, 2022 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infamousjoeg/7b6eb2c51540b1f982f7700bcf0100b0 to your computer and use it in GitHub Desktop.
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
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