Skip to content

Instantly share code, notes, and snippets.

@infamousjoeg
Created November 9, 2022 20:10
Embed
What would you like to do?
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