Skip to content

Instantly share code, notes, and snippets.

@tschm
Created April 27, 2016 13:32
Show Gist options
  • Save tschm/cba7e14c29e9c83c1662f0b45e1a7a4f to your computer and use it in GitHub Desktop.
Save tschm/cba7e14c29e9c83c1662f0b45e1a7a4f to your computer and use it in GitHub Desktop.
Bash script to install a tagged version of a git repository
rm -rf pybank
# clone the entire github repository. This is kind of inefficient as we delete the .git folder in a moment
git clone [email protected]:lobnek/pybank.git
cd pybank
VERSION=$1
if [ "$VERSION" == "" ]
then
VERSION=`git describe --abbrev=0`
fi
echo $VERSION
# checkout the correct version
git checkout $VERSION --
# Print the version into a txt file
echo $VERSION > configurations/version.txt
# Build the Python environment using conda
make build
make test
# delete a bunch of files not needed on the server but contained in the git repository (documentation etc.)
xargs rm -rf < delete.txt
rm delete.txt
# back into the folder
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment