Last active
November 13, 2020 15:32
-
-
Save ezarko/e8c4f31900b4e0e668c7be8c32acf5bd to your computer and use it in GitHub Desktop.
Creates a "reference repository" on a Jenkins slave to speed up build times.
This file contains hidden or 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
#!/bin/bash | |
# Creates a "reference repository" on a Jenkins slave to speed up build times. | |
# Assumes that you will clone using HTTPS and enter username/password, then | |
# Jenkins will use an SSH key in the future. | |
# | |
# Works with Jenkins and GitLab. For other applications your mileage may vary. | |
REPO_SERVER=osn-git.us.oracle.com | |
REPO_PATH=ccs/caas.git | |
CACHEDIR=~/gitcaches | |
################################################################################ | |
REF=$CACHEDIR/${REPO_PATH##*/} | |
REF=${REF%.git}.reference | |
mkdir -p $CACHEDIR | |
git clone --mirror https://$REPO_SERVER/$REPO_PATH $REF | |
(cd $REF; git remote set-url origin git@$REPO_SERVER:$REPO_PATH) | |
echo "Git reference path: $REF" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment