Commit b7f7b111 authored by Duncan Macleod's avatar Duncan Macleod

Merge branch 'debian' into 'master'

Improved debian packaging

See merge request duncanmmacleod/gwdatafind-server!2
parents 4a7210af 6926ac9f
Pipeline #60874 passed with stages
in 2 minutes and 16 seconds
......@@ -18,6 +18,9 @@ variables:
paths:
- dist
.run-tests: &run-tests |
python3 -m pytest tests --cov=gwdatafind_server --junitxml=junit.xml
# -- lint -------------------
lint:
......@@ -51,6 +54,12 @@ dist:tarball:
stage: build
dependencies:
- dist:tarball
artifacts:
expire_in: 18h
paths:
- dist
reports:
junit: junit.xml
.build:debian: &build-debian
<<: *build
......@@ -59,20 +68,34 @@ dist:tarball:
- apt-get install -yq
dpkg-dev
devscripts
lintian
script:
- DIST_NAME=${CI_JOB_NAME#build:debian:}
- mkdir -pv dist/${DIST_NAME}
# unpack tarball
- mkdir -pv build
- tar -xvf dist/gwdatafind-server-*.tar.gz -C ./build --strip-components=1
- rm -rf dist/*
- pushd build
# install build dependencies
- mk-build-deps --tool "apt-get -y" --install --remove
# build debian packages
- dpkg-buildpackage -us -uc -b
# lint the package
- lintian -v gwdatafind-server_*.changes
# install the package
- dpkg --install gwdatafind-server_*.deb || {
apt-get -y -f install;
dpkg --install ${GWPY_DEB};
}
# run the tests (in a separate directory path)
- mkdir -p testing
- cd testing
- cp -r ../tests .
- *run-tests
# move things into dist/
- popd
- mv -v {python,python3}-gwdatafind-server_*.deb gwdatafind-server_*.{buildinfo,changes} dist/${DIST_NAME}/
- DIST_DIR="dist/${CI_JOB_NAME#build:debian:}"
- mkdir -pv ${DIST_DIR}
- mv -v python3-gwdatafind-server_*.deb gwdatafind-server_*.{buildinfo,changes} ${DIST_DIR}/
build:debian:buster:
<<: *build-debian
......@@ -92,7 +115,7 @@ build:debian:buster:
"pytest>=2.8.0"
"pytest-cov"
script:
- python -m pytest tests --cov=gwdatafind_server --junitxml=junit.xml
- *run-tests
cache:
key: "${CI_JOB_NAME}"
paths:
......
......@@ -5,12 +5,13 @@ Maintainer: Duncan Macleod <duncan.macleod@ligo.org>
Section: python
Priority: optional
Standards-Version: 3.9.1
X-Python3-Version: >= 3.4
X-Python3-Version: >= 3.6
Build-Depends: debhelper (>= 9),
dh-python,
python3-all,
python3-setuptools,
python3-configobj,
python3-flask (>= 1.0.0),
python3-ligo-segments,
# -- python3-gwdatafind-server ------------------
......@@ -20,6 +21,7 @@ Architecture: all
Depends: ${misc:Depends},
${python3:Depends},
python3-configobj,
python3-flask (>= 1.0.0),
python3-ligo-segments
Description: The server library for the GWDataFind service
.
......
#!/usr/bin/make -f
export PYBUILD_NAME = gwdatafind-server
export PYBUILD_DISABLE = test
%:
dh $@ --with python3 --buildsystem=pybuild
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