Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code for build debian packages #943

Merged
merged 1 commit into from
Oct 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .bintray.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"package": {
"name": "python-alignak",
"repo": "alignak_deb-testing",
"subject": "ddurieux",
"vcs_url": "https://github.com/Alignak-monitoring/alignak",
"licenses": ["AGPL-V3"]
},
"version": {
"name": "dev"
},
"files": [
{
"includePattern": "./(.*\\.deb)",
"uploadPattern": "$1",
"matrixParams": {
"override": 1,
"deb_distribution": "jessie,Stretch,Trusty,xenial,Yakkety,Zesty,Artful",
"deb_component": "main",
"deb_architecture": "all"
}
}
],
"publish": true
}
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ after_success:
- echo "Test Success - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)"
# Send coverage report only for the Python 2.7 unit tests
- if [[ $TEST_SUITE == 'unit' && $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ./.travis/report_coveralls.sh; fi
- if [[ $TEST_SUITE == 'unit' && $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ./package.sh $TRAVIS_BRANCH $TRAVIS_PYTHON_VERSION; fi

notifications:
webhooks:
Expand All @@ -51,3 +52,21 @@ notifications:
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # default: false

deploy:
- provider: bintray
skip_cleanup: true
file: .bintray.json
user: ddurieux
key:
secure: "yuhgpgyEEvYnY1+a+Y68L7nFFUJYcSAOEo66pYis8ZduHN+1NWbynDdu7I/ndgk66iZOFA2XyVccE9kP0lLpAcQI2h8/nxFnydwzASJTusacgh/CJPrcNCbS+j/y7pWRDKkH9HRy9FWwx0DWm4PYiDe4kPVqsymuHV5eZmFpQfJMsc8e+/mfFJ2d7P0RC2fEEM1fpOhiVmL8WePmxLaNtoPudFeDHNVYd1ebNdDcmpsiLQeG/aRO2/kKGlbTREN+pm83VstwBOiVfiz3I3aj9EUz1XTTQUlVL9nTkNjwcmyF0YI5wR0ef6re0lDKrgISsRN3QP9/YJ0596k1CwRXr08vUKqMw2pZMAzNyJiyGTwus0+NN8zopLEz+ZfmRBViz/Qh8oTvgso9LQPzvy8LDEpfAzS9WHJFvkJm/SlT7VNHfJfh5SLuVWrt532Aqr6dhyuMBisQdwAo2Fo1DLkJDDDRAEiuJbceTZMYoQv29yTj81cVUmdCa67b9BrRbn+c//2xmZXpcbcyoEOjMBvIN1tlyvh7A/CoHflQak16TPfS5YkFDiy/2YTGi2aYlFVkdJwdU77By7IA2cGnupyywfOOxmLl1x/rnKfJ06G2vblBYSkBCiokO2pwArUZW2W5yVY7ycf/fMOiqKDpn2RJYqpeloeDf+c0aZFTmvzY4ug="
on:
branch: develop
- provider: bintray
skip_cleanup: true
file: .bintray.json
user: ddurieux
key:
secure: "yuhgpgyEEvYnY1+a+Y68L7nFFUJYcSAOEo66pYis8ZduHN+1NWbynDdu7I/ndgk66iZOFA2XyVccE9kP0lLpAcQI2h8/nxFnydwzASJTusacgh/CJPrcNCbS+j/y7pWRDKkH9HRy9FWwx0DWm4PYiDe4kPVqsymuHV5eZmFpQfJMsc8e+/mfFJ2d7P0RC2fEEM1fpOhiVmL8WePmxLaNtoPudFeDHNVYd1ebNdDcmpsiLQeG/aRO2/kKGlbTREN+pm83VstwBOiVfiz3I3aj9EUz1XTTQUlVL9nTkNjwcmyF0YI5wR0ef6re0lDKrgISsRN3QP9/YJ0596k1CwRXr08vUKqMw2pZMAzNyJiyGTwus0+NN8zopLEz+ZfmRBViz/Qh8oTvgso9LQPzvy8LDEpfAzS9WHJFvkJm/SlT7VNHfJfh5SLuVWrt532Aqr6dhyuMBisQdwAo2Fo1DLkJDDDRAEiuJbceTZMYoQv29yTj81cVUmdCa67b9BrRbn+c//2xmZXpcbcyoEOjMBvIN1tlyvh7A/CoHflQak16TPfS5YkFDiy/2YTGi2aYlFVkdJwdU77By7IA2cGnupyywfOOxmLl1x/rnKfJ06G2vblBYSkBCiokO2pwArUZW2W5yVY7ycf/fMOiqKDpn2RJYqpeloeDf+c0aZFTmvzY4ug="
on:
tags: true
2 changes: 2 additions & 0 deletions install_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def fix_alignak_cfg(config):
# This file may exist on older installation... or for init.d start systems
cfg_file_name = ''
etc_default_alignak = os.path.join("etc", "default", "alignak")
if 'package-python-staging' in config.install_dir:
config.install_dir = re.sub(r"^/tmp/package-python-staging-[0-9a-f]+", "", config.install_dir)
use_local_etc_default_alignak = os.path.join(config.install_dir, "etc", "default", "alignak")
if os.path.exists(etc_default_alignak):
cfg_file_name = etc_default_alignak
Expand Down
27 changes: 27 additions & 0 deletions package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

set -ev

cd ..
git clone https://github.com/Alignak-monitoring/alignak-packaging.git
sed -i -e 's/\/usr\/bin/\/usr\/local\/bin/g' alignak-packaging/alignak/systemd/*
sed -i -e 's/ \/etc\/alignak/ \/usr\/local\/etc\/alignak/g' alignak-packaging/alignak/systemd/*
cd alignak

gem install fpm

# Debian

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" -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 ../alignak-packaging/alignak/systemd/alignak-arbiter.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak-broker.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak-poller.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak-reactionner.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak-receiver.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak-scheduler.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak.service --deb-no-default-config-files --python-install-data '/usr/local' --python-install-bin '/usr/local/bin' ./setup.py
version=`python -c "from alignak import __version__;print(__version__)"`
fi
sed -i -e "s|\"dev\"|\"${version}\"|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" -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 ../alignak-packaging/alignak/systemd/alignak-arbiter.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak-broker.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak-poller.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak-reactionner.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak-receiver.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak-scheduler.service --deb-systemd ../alignak-packaging/alignak/systemd/alignak.service --deb-no-default-config-files --python-install-data '/usr/local' --python-install-bin '/usr/local/bin' ./setup.py
fi
fi