Created
February 13, 2014 11:35
-
-
Save cedricziel/8973606 to your computer and use it in GitHub Desktop.
Openshift git wrapper script creation for being able to use private git repos
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
#!/usr/bin/env bash | |
# copy this script to your gear, make it executable and run it once | |
# make the appropriate directory | |
mkdir -p "$OPENSHIFT_DATA_DIR/.ssh" | |
# generate a key | |
ssh-keygen -q -t rsa -f $OPENSHIFT_DATA_DIR/.ssh/id_rsa -N "" | |
# create a wrapper script | |
printf "#!/bin/bash \nssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${OPENSHIFT_DATA_DIR}.ssh/id_rsa $1 $2" > $OPENSHIFT_DATA_DIR/git-ssh | |
# make the wrapper executable | |
chmod +x "$OPENSHIFT_DATA_DIR/git-ssh" | |
# add the wrapper to .bash_profile so it will be used everywhere | |
echo "export GIT_SSH=$OPENSHIFT_DATA_DIR/git-ssh" >> $OPENSHIFT_DATA_DIR/.bash_profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you doc!
Very usefful!