Commit e082ad0c authored by Alexander Pace's avatar Alexander Pace

Merge branch 'new-ci' into 'master'

Restructure CI to improve build and in-situ testing

See merge request lscsoft/lvalert!25
parents de65362f 550e9549
Pipeline #110324 passed with stages
in 4 minutes and 17 seconds
stages:
- dist
- build
- test
- deploy
# -- build ------------------
.build: &build
stage: build
.dist-artifacts: &dist-artifacts
after_script:
- ls -l dist/
- find dist
artifacts:
expire_in: 3h
paths:
- dist
build:tarball:
<<: *build
image: python:3.6
dist:tarball:
<<: *dist-artifacts
stage: dist
image: python:3.7
script:
- python -m pip install six sleekxmpp
- python -m pip install setuptools
- python setup.py --version > .version
- python setup.py sdist bdist_wheel
artifacts:
paths:
- dist
- .version
# -- build ------------------
.build: &build
<<: *dist-artifacts
stage: build
build:el7:
<<: *build
image: igwn/base:el7
before_script:
- yum install -yq
rpm-build
epel-rpm-macros
python-rpm-macros
python3-rpm-macros
python-setuptools
python3-setuptools
python2-six
python36-six
- yum -y -q update
- yum -y -q install yum-utils rpm-build epel-rpm-macros
script:
- python setup.py sdist
- rpmbuild -tb dist/ligo-lvalert*.tar.gz
- mv -v ~/rpmbuild/RPMS/*/python*-ligo-lvalert-*.rpm dist/
- rm -rf dist/*.tar.gz
- VERSION=$(cat .version)
- pushd dist
# generate SRC_RPM
- rpmbuild -ts --define "_srcrpmdir $(pwd)" ligo-lvalert-${VERSION}.tar.gz
- SRC_RPM="ligo-lvalert-${VERSION}*.src.rpm"
# install build requirements
- yum-builddep -y -q ${SRC_RPM}
# build binary rpms
- rpmbuild --rebuild --define "_rpmdir $(pwd)" ${SRC_RPM}
artifacts:
paths:
- "dist/*.rpm"
- "dist/*/*.rpm"
#-- begin debian section
.configure_lscdebian: &configure-lscdebian |
apt-get update -yqq;
apt-get install -yqq apt-transport-https ca-certificates lsb-release;
CODENAME=$(lsb_release --codename --short);
echo "deb [trusted=yes] https://galahad.aei.mpg.de/lsc-amd64-${CODENAME} ./" > /etc/apt/sources.list.d/lscsoft.list;
.build:debian: &build_debian
<<: *build
before_script:
- *configure-lscdebian
- apt-get update -yqq
- apt-get install -yq
dpkg-dev
debhelper
dh-python
python-all-dev
python3-all-dev
python-setuptools
python3-setuptools
python-six
python3-six
python-sleekxmpp
python3-sleekxmpp
python-dnspython
python3-dnspython
help2man
- apt-get install -yqq dpkg-dev devscripts;
script:
- VERSION=$(cat .version)
- pushd .
- python setup.py sdist
- version=$(python setup.py --version)
- cd dist
- tar -xf ligo-lvalert-${version}.tar.gz
- cd ligo-lvalert-${version}
# unpack tarball
- tar -xf ligo-lvalert-${VERSION}.tar.gz
- cd ligo-lvalert-${VERSION}
# install build-depends
- mk-build-deps --tool "apt-get -y" --install --remove
# build binary packages
- dpkg-buildpackage -us -uc -b
- popd
- rm -rf dist/ligo-lvalert*
build:debian:jessie:
<<: *build_debian
image: debian:jessie
# clean up tarball and build folder (to remove from artefacts)
- rm -rf dist/ligo-lvalert-${VERSION}*
build:debian:stretch:
<<: *build_debian
image: debian:stretch
build:debian:buster:
<<: *build_debian
image: debian:buster
# -- test -------------------
#.test: &test
# stage: test
# image: python
# before_script:
# - python -m pip install six sleekxmpp
# - python -m pip install -U .
# script:
# - python -c "from ligo.lvalert import sleeklvalert"
# - lvalert --help
# - lvalert_admin --help
# - lvalert_listen --help
# - lvalert_send --help
.test: &test
stage: test
needs:
- dist:tarball
variables:
COMMAND_LINE_SUPPORT: 1
LEGACY_SUPPORT: 0
before_script:
- set -x;
- PYTHON_VERSION=${CI_JOB_NAME##*:}
- python${PYTHON_VERSION} -m pip install dist/ligo-lvalert-*.tar.gz
script:
- python${PYTHON_VERSION} -c "from ligo import lvalert"
- if [ "${COMMAND_LINE_SUPPORT}" -eq 1 ]; then
lvalert --help;
if [ "${LEGACY_SUPPORT}" -eq 1 ]; then
lvalert_admin --help;
lvalert_listen --help;
lvalert_send --help;
fi;
fi
.test-rhel: &test-rhel
<<: *test
before_script:
- set -x;
- yum -y -q update
- PYTHON_VERSION=${CI_JOB_NAME##*:}
- PYV="${PYTHON_VERSION:0:1}"
- yum -y -q install dist/*/python${PYV}*.rpm
.test-debian: &test-debian
<<: *test
before_script:
- set -x;
- *configure-lscdebian
- apt-get -yqq update
- PYTHON_VERSION=${CI_JOB_NAME##*:}
- |
if [ ${PYTHON_VERSION:0:1} -eq 2 ]; then
PYV="";
else
PYV="${PYTHON_VERSION:0:1}";
fi
- dpkg --install dist/python${PYV}-*.deb || { apt-get -y -f install; dpkg -i dist/python${PYV}-*.deb; }
test:2.7:
<<: *test
image: python:2.7
test:3.5:
<<: *test
image: python:3.5
test:3.6:
<<: *test
image: python:3.6
test:3.7:
<<: *test
image: python:3.7
test:3.8:
<<: *test
image: python:3.8
test:el7:2.7:
<<: *test-rhel
image: igwn/base:el7
needs:
- build:el7
variables:
COMMAND_LINE_SUPPORT: 1
LEGACY_SUPPORT: 1
test:el7:3.6:
<<: *test-rhel
image: igwn/base:el7
needs:
- build:el7
variables:
# scripts are only included for py27 on rhel
COMMAND_LINE_SUPPORT: 0
test:stretch:2.7:
<<: *test-debian
image: debian:stretch
needs:
- build:debian:stretch
test:stretch:3.5:
<<: *test-debian
image: debian:stretch
needs:
- build:debian:stretch
variables:
# scripts are only included for py27 on debian
COMMAND_LINE_SUPPORT: 0
test:buster:2.7:
<<: *test-debian
image: debian:buster
needs:
- build:debian:buster
test:buster:3.7:
<<: *test-debian
image: debian:buster
needs:
- build:debian:buster
variables:
# scripts are only included for py27 on debian
COMMAND_LINE_SUPPORT: 0
doc:
stage: test
image: python:3.6
image: python:3.7
before_script:
- pip install recommonmark sphinx sphinx-argparse sphinx_rtd_theme sleekxmpp
script:
......@@ -117,13 +227,3 @@ pages:
expire_in: 30 days
only:
- master
#test:python2.7:
# <<: *test
# image: python:2.7
#test:python3.6:
# <<: *test
# image: python:3.6
......@@ -2,33 +2,49 @@ Source: ligo-lvalert
Maintainer: Alexander Pace <alexander.pace@ligo.org>, Tanner Prestegard <tanner.prestegard@ligo.org>, Leo Singer <leo.singer@ligo.org>
Section: python
Priority: optional
Build-Depends: debhelper (>= 9), dh-python, python-all-dev, python3-all-dev, python-setuptools, python3-setuptools,
python-six, python3-six,
python-dnspython, python3-dnspython,
python-sleekxmpp, python3-sleekxmpp,
help2man
Build-Depends:
debhelper (>= 9),
dh-python,
python-all-dev, python3-all-dev,
python-setuptools, python3-setuptools,
python-six, python3-six,
python-dnspython, python3-dnspython,
python-sleekxmpp, python3-sleekxmpp,
help2man,
Standards-Version: 3.8.4
X-Python-Version: >=2.7
X-Python3-Version: >=3.4
Package: python-ligo-lvalert
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, python-pyxmpp, python-libxml2, python-dnspython, python-ligo-common
Depends:
${misc:Depends},
${python:Depends},
python-pyxmpp,
python-dnspython,
python-libxml2,
python-ligo-common,
python-pyasn1,
Provides: ${python:Provides}
Description: LIGO-Virgo Alert Network - Python
The LIGO-Virgo Alert Network (LVAlert) is a prototype notification service
built XMPP to provide a basic notification tool which allows multiple
producers and consumers of notifications.
.
This package provides Python support.
This package provides Python 2 support.
Package: python3-ligo-lvalert
Architecture: all
Depends: ${misc:Depends}, ${python3:Depends}, python3-dnspython, python3-ligo-common, python3-sleekxmpp
Depends:
${misc:Depends},
${python3:Depends},
python3-dnspython,
python3-ligo-common,
python3-sleekxmpp,
Provides: ${python3:Provides}
Description: LIGO-Virgo Alert Network - Python
The LIGO-Virgo Alert Network (LVAlert) is a prototype notification service
built XMPP to provide a basic notification tool which allows multiple
producers and consumers of notifications.
.
This package provides Python support.
This package provides Python 3 support.
......@@ -17,8 +17,8 @@ Url: https://wiki.ligo.org/DASWG/LVAlert
BuildArch: noarch
BuildRequires: rpm-build
BuildRequires: epel-rpm-macros
BuildRequires: python-rpm-macros
BuildRequires: python2-rpm-macros
BuildRequires: python3-rpm-macros
BuildRequires: python-setuptools
BuildRequires: python%{python3_pkgversion}-setuptools
......@@ -50,8 +50,8 @@ tools for interacting with the LVAlert jabber server.
%package -n python%{python3_pkgversion}-%{name}
Summary: %{summary}
Requires: python%{python3_pkgversion}-six
Requires: python%{python3_pkgversion}-ligo-common
Requires: python%{python3_pkgversion}-six
Requires: python%{python3_pkgversion}-sleekxmpp
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
......
......@@ -39,7 +39,6 @@ install_requires =
pyasn1>=0.1.8
pyasn1-modules>=0.0.5
ligo-common
safe-netrc
sleekxmpp>=1.3.3
numpy
six
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment