Created
October 9, 2011 19:28
-
-
Save jlecour/1274052 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
#!/bin/sh | |
set -e | |
# git name-rev is fail | |
CURRENT=`git branch | grep '\*' | awk '{print $2}'` | |
if [ "master" = "${CURRENT}" ] | |
then | |
OUT='gem.out' | |
gem build my_gem.gemspec > $OUT | |
cat $OUT | |
PROJECT=`awk '{ if (NR == 2) { print $2; } }' $OUT` | |
VERSION=`awk '{ if (NR == 3) { print $2; } }' $OUT` | |
FILE=`awk '{ if (NR == 4) { print $2; } }' $OUT` | |
rm $OUT | |
echo "Fabrication de $FILE : OK" | |
gem inabox $FILE | |
echo "Publication dans le dépôt : OK" | |
git tag v$VERSION | |
git push --tags | |
echo "Tag Git : OK" | |
else | |
echo "Impossible de passer en production sans être sur 'master'" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment