Created
June 6, 2024 03:19
-
-
Save DefectingCat/35dc42b8301bf81b9438aa725a9d8a73 to your computer and use it in GitHub Desktop.
gitlab ci docker runner use ssh private key
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
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