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