Created
December 27, 2019 11:08
-
-
Save andypost/7633583aae09f8ec0246bfaf6ff713ca to your computer and use it in GitHub Desktop.
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
backup:git: | |
variables: | |
GIT_DEPTH: "" | |
GIT_STRATEGY: clone | |
stage: backup | |
environment: dev | |
script: | |
- apk add --no-cache openssh-client | |
- echo "${GIT_BACKUP_RSA_PUB_KEY}" > ssh_key | |
- chmod 0600 ssh_key | |
- git checkout -f ${CI_COMMIT_REF_NAME} | |
- git remote add gitolite ssh://${GIT_BACKUP_USER}@${GIT_BACKUP_HOSTNAME}:${GIT_BACKUP_PORT}/${GIT_BACKUP_REPOSITORY_NAME} | |
- GIT_SSH_COMMAND="ssh -i ./ssh_key | |
-o User=${GIT_BACKUP_USER} | |
-o Port=${GIT_BACKUP_PORT} | |
-o HostName=${GIT_BACKUP_HOSTNAME} | |
-o StrictHostKeyChecking=no" | |
git push -f -v --tags gitolite ${CI_COMMIT_REF_NAME} | |
dependencies: | |
- test:install:config | |
only: | |
- /(integration|release|s[\d+])$/ | |
- tags | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment