Skip to content

Commit

Permalink
Fix Travis deploy egg info
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Feb 13, 2015
1 parent 42ebc2f commit 8fb9f66
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
#!/bin/bash
#!/bin/bash -e

DEPLOY=false
EGG_INFO=""
FINAL=false

if [[ $TRAVIS_BRANCH =~ ^(master|[0-9].[0-9])$ ]] && [ $TRAVIS_PULL_REQUEST == false ]
if [[ ${TRAVIS_BRANCH} =~ ^(master|[0-9].[0-9])$ ]] && [ ${TRAVIS_PULL_REQUEST} == false ]
then
DEPLOY=true
fi

if [[ $TRAVIS_TAG =~ ^[0-9].[0-9]+.[0-9]$ ]]
if [[ ${TRAVIS_TAG} =~ ^[0-9].[0-9]+.[0-9]$ ]]
then
if [ $TRAVIS_TAG != $(python setup.py -V) ]
if [ ${TRAVIS_TAG} != $(python setup.py -V) ]
then
echo "The tag name doesn't match with the egg version."
exit 1
fi
DEPLOY=true
EGG_INFO="egg_info --no-date --tag-build"
FINAL=true
fi

if [ $DEPLOY == true ] && [ $TRAVIS_PYTHON_VERSION == "2.7" ]
if [ ${DEPLOY} == true ] && [ ${TRAVIS_PYTHON_VERSION} == "2.7" ]
then
echo "[distutils]" > ~/.pypirc
echo "index-servers = c2c-internal" >> ~/.pypirc
echo "[c2c-internal]" >> ~/.pypirc
echo "username:$PIP_USERNAME" >> ~/.pypirc
echo "password:$PIP_PASSWORD" >> ~/.pypirc
echo "username:${PIP_USERNAME}" >> ~/.pypirc
echo "password:${PIP_PASSWORD}" >> ~/.pypirc
echo "repository:http://pypi.camptocamp.net/internal-pypi/simple" >> ~/.pypirc

./buildout/bin/python setup.py $EGG_INFO sdist upload -r c2c-internal
set -x

if [ ${FINAL} == true ]
then
./buildout/bin/python setup.py egg_info --no-date --tag-build "" sdist upload -r c2c-internal
else
./buildout/bin/python setup.py sdist upload -r c2c-internal
fi

cd c2cgeoportal/scaffolds/update/+package+/static/mobile/
tar -czvf touch.tar.gz touch
cd -
echo "include c2cgeoportal/scaffolds/update/+package+/static/mobile/touch.tar.gz" >> MANIFEST.in
echo "prune c2cgeoportal/scaffolds/update/+package+/static/mobile/touch" >> MANIFEST.in
sed -i "s/name='c2cgeoportal',/name='c2cgeoportal-win',/g" setup.py
./buildout/bin/python setup.py sdist upload -r c2c-internal

if [ ${FINAL} == true ]
then
./buildout/bin/python setup.py egg_info --no-date --tag-build "" sdist upload -r c2c-internal
else
./buildout/bin/python setup.py sdist upload -r c2c-internal
fi
fi

0 comments on commit 8fb9f66

Please sign in to comment.