Skip to content

Instantly share code, notes, and snippets.

@DefectingCat
Created June 6, 2024 03:19
Show Gist options
  • Save DefectingCat/35dc42b8301bf81b9438aa725a9d8a73 to your computer and use it in GitHub Desktop.
Save DefectingCat/35dc42b8301bf81b9438aa725a9d8a73 to your computer and use it in GitHub Desktop.
gitlab ci docker runner use ssh private key
before_script:
- "command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )"
- eval $(ssh-agent -s)
- chmod 400 "$SSH_PRIVATE_KEY"
- ssh-add "$SSH_PRIVATE_KEY"
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment