Created
August 20, 2013 19:53
-
-
Save stevegrunwell/6286357 to your computer and use it in GitHub Desktop.
Easily add a new Bitbucket repo on a Redmine server. Add this to the Redmine user's .bash_profile, run `bitbucket-add-repository <slug>`, then add the repo to Redmine project configuration. Modifying this to use with Github is trivial, just update [email protected] to [email protected] (and update textual references, of course).
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
# Create a bare clone in ~/git_repositories/{slug}.git | |
# Before running this command ensure that the repo on Bitbucket has an appropriate deploy key. | |
# You'll also want to set a POST hook (e.g. http://{redmine}/github_hook?project_id={slug}) | |
# | |
# Usage: bitbucket-add-repository <slug> | |
function bitbucket-add-repository { | |
base=/home/redmine/git_repositories/ | |
if [ -n "$1" ]; then | |
path=$base$1.git | |
git clone --bare [email protected]:buckii/$1.git $path | |
echo -e "\nWhen prompted by Redmine provide the following path:\n$path\n" | |
else | |
echo "You must specify a Bitbucket repo name (minus the .git extension) to clone" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment