Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Simplify version artifact to txt file (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Dec 6, 2012
1 parent 5ba8239 commit 84e5b1e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
25 changes: 13 additions & 12 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,31 +66,32 @@ if [ $1 ]; then
confirm "Tag and push version $1?"
if [ $? -eq 0 ]; then

# Fix the version.
# ================
# Bump the version.
# =================

sed -e "s/~~VERSION~~/$1/" -i '' gittip/__init__.py
git ci gittip/__init__.py \
-m"Setting version to $1 in gittip/__init__.py."
printf "$1" > www/version.txt
git ci www/version.txt -m"Bump version to $1"
git tag $1


# Deploy to Heroku.
# =================
# If this fails we still want to reset the version, so modify bash
# error handling around this call.
# If this fails we still want to bump the version again, so modify
# bash error handling around this call.

set +e
git push heroku
set -e


# Change the version back.
# ========================
# Bump the version again.
# =======================
# We're using a Pythonic convention here by using -dev to mean, "a
# dev version following $whatever." We escape the dash for bash's
# sake

sed -e "s/$1/~~VERSION~~/" -i '' gittip/__init__.py
git ci gittip/__init__.py \
-m"Resetting version in gittip/__init__.py."
printf "\055dev" >> www/version.txt
git ci www/version.txt -m"Bump version to $1\055dev"

fi
fi
Expand Down
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import os
from setuptools import setup, find_packages
from gittip import __version__


def get_version():
try:
return open(os.path.join('www', 'version.txt')).read().strip()
except OSError:
return 'n/a'


setup( name='gittip'
, version=__version__
, version=get_version()
, packages=find_packages()
, entry_points = { 'console_scripts'
: [ 'payday=gittip.cli:payday'
Expand Down

0 comments on commit 84e5b1e

Please sign in to comment.