Skip to content

Commit

Permalink
Python3 version:
Browse files Browse the repository at this point in the history
- give a try for packaging - update packaging script
  • Loading branch information
mohierf committed May 19, 2018
1 parent 1ab543a commit e396a4c
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,43 @@ set -ev

gem install fpm

echo "Building packages for branch $1, python version $2"

# Debian

# Get Alignak version
version=`python -c "from alignak import __version__;print(__version__)"`

if [ "$1" = "master" ]; then
if [ "$2" = "2.7" ]; then
fpm --debug -s python --python-scripts-executable "/usr/bin/python" --python-install-lib "/usr/lib/python2.7/dist-packages" --python-install-data '/usr/local' --python-install-bin '/usr/local/bin' -t deb -a all --python-disable-dependency pyopenssl --python-disable-dependency termcolor --python-disable-dependency CherryPy -d python-cherrypy3 -d python-openssl -d python-termcolor --deb-systemd ./systemd/alignak-arbiter@.service --deb-systemd ../systemd/alignak-broker.@service --deb-systemd ./systemd/alignak-poller@.service --deb-systemd ./systemd/alignak-reactionner@.service --deb-systemd ./systemd/alignak-receiver@.service --deb-systemd ./systemd/alignak-scheduler@.service --deb-systemd ./systemd/alignak.service --deb-no-default-config-files ./setup.py
version=`python -c "from alignak import __version__;print(__version__)"`
fi
# Updating deploy script
sed -i -e "s|\"dev\"|\"${version}\"|g" .bintray.json
sed -i -e "s|\"Development\"|\"Stable\"|g" .bintray.json
sed -i -e s/alignak_deb-testing/alignak_deb-stable/g .bintray.json
elif [ "$1" = "develop" ]; then
DEVVERSION=`date "+%Y%m%d%H%M%S"`
if [ "$2" = "2.7" ]; then
fpm --debug -s python --python-scripts-executable "/usr/bin/python" --python-install-lib "/usr/lib/python2.7/dist-packages" --python-install-data '/usr/local' --python-install-bin '/usr/local/bin' -t deb -a all -v $DEVVERSION-dev --python-disable-dependency pyopenssl --python-disable-dependency termcolor --python-disable-dependency CherryPy -d python-cherrypy3 -d python-openssl -d python-termcolor --deb-systemd ./systemd/alignak-arbiter@.service --deb-systemd ./systemd/alignak-broker@.service --deb-systemd ./systemd/alignak-poller@.service --deb-systemd ./systemd/alignak-reactionner@.service --deb-systemd ./systemd/alignak-receiver@.service --deb-systemd ./systemd/alignak-scheduler@.service --deb-systemd ./systemd/alignak.service --deb-no-default-config-files ./setup.py
sed -i -e "s|\"dev\"|\"${version}\"|g" .bintray.json
sed -i -e s/alignak_deb-testing/alignak_deb-stable/g .bintray.json
fi

fpm --debug -s python -t deb -a all --python-scripts-executable "/usr/bin/python" --python-install-lib "/usr/lib/python2.7/dist-packages" --python-install-data '/usr/local' --python-install-bin '/usr/local/bin' -v $DEVVERSION-dev

--python-disable-dependency pyopenssl
--python-disable-dependency termcolor
--python-disable-dependency CherryPy
-d python-cherrypy3
-d python-openssl
-d python-termcolor
--deb-systemd ./systemd/alignak-arbiter@.service
--deb-systemd ./systemd/alignak-broker@.service --deb-systemd ./systemd/alignak-poller@.service --deb-systemd ./systemd/alignak-reactionner@.service --deb-systemd ./systemd/alignak-receiver@.service --deb-systemd ./systemd/alignak-scheduler@.service --deb-systemd ./systemd/alignak.service
--deb-no-default-config-files ./setup.py

# Updating deploy script
sed -i -e "s|\"dev\"|\"${DEVVERSION}\"|g" .bintray.json
# sed -i -e s/alignak_deb-testing/alignak_deb-stable/g .bintray.json
else
# Any other branch
# Updating deploy script
sed -i -e "s|\"dev\"|\"$1\"|g" .bintray.json
fi

# Run fpm:
# - debug mode to have information
# - from python to deb packages, for all
fpm --debug -s python -t deb -a all --python-scripts-executable "/usr/bin/python" --python-install-lib "/usr/lib/python2.7/dist-packages" --python-install-data '/usr/local' --python-install-bin '/usr/local/bin' --python-disable-dependency pyopenssl --python-disable-dependency termcolor --python-disable-dependency CherryPy -d python-cherrypy3 -d python-openssl -d python-termcolor --deb-systemd ./systemd/alignak-arbiter@.service --deb-systemd ../systemd/alignak-broker.@service --deb-systemd ./systemd/alignak-poller@.service --deb-systemd ./systemd/alignak-reactionner@.service --deb-systemd ./systemd/alignak-receiver@.service --deb-systemd ./systemd/alignak-scheduler@.service --deb-systemd ./systemd/alignak.service --deb-no-default-config-files ./setup.py

0 comments on commit e396a4c

Please sign in to comment.