...
 
Commits (3)
...@@ -18,6 +18,9 @@ variables: ...@@ -18,6 +18,9 @@ variables:
paths: paths:
- dist - dist
.run-tests: &run-tests |
python3 -m pytest tests --cov=gwdatafind_server --junitxml=junit.xml
# -- lint ------------------- # -- lint -------------------
lint: lint:
...@@ -51,6 +54,12 @@ dist:tarball: ...@@ -51,6 +54,12 @@ dist:tarball:
stage: build stage: build
dependencies: dependencies:
- dist:tarball - dist:tarball
artifacts:
expire_in: 18h
paths:
- dist
reports:
junit: junit.xml
.build:debian: &build-debian .build:debian: &build-debian
<<: *build <<: *build
...@@ -59,20 +68,34 @@ dist:tarball: ...@@ -59,20 +68,34 @@ dist:tarball:
- apt-get install -yq - apt-get install -yq
dpkg-dev dpkg-dev
devscripts devscripts
lintian
script: script:
- DIST_NAME=${CI_JOB_NAME#build:debian:}
- mkdir -pv dist/${DIST_NAME}
# unpack tarball # unpack tarball
- mkdir -pv build - mkdir -pv build
- tar -xvf dist/gwdatafind-server-*.tar.gz -C ./build --strip-components=1 - tar -xvf dist/gwdatafind-server-*.tar.gz -C ./build --strip-components=1
- rm -rf dist/*
- pushd build - pushd build
# install build dependencies # install build dependencies
- mk-build-deps --tool "apt-get -y" --install --remove - mk-build-deps --tool "apt-get -y" --install --remove
# build debian packages # build debian packages
- dpkg-buildpackage -us -uc -b - 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/ # move things into dist/
- popd - 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:buster:
<<: *build-debian <<: *build-debian
...@@ -92,7 +115,7 @@ build:debian:buster: ...@@ -92,7 +115,7 @@ build:debian:buster:
"pytest>=2.8.0" "pytest>=2.8.0"
"pytest-cov" "pytest-cov"
script: script:
- python -m pytest tests --cov=gwdatafind_server --junitxml=junit.xml - *run-tests
cache: cache:
key: "${CI_JOB_NAME}" key: "${CI_JOB_NAME}"
paths: paths:
......
...@@ -5,12 +5,13 @@ Maintainer: Duncan Macleod <duncan.macleod@ligo.org> ...@@ -5,12 +5,13 @@ Maintainer: Duncan Macleod <duncan.macleod@ligo.org>
Section: python Section: python
Priority: optional Priority: optional
Standards-Version: 3.9.1 Standards-Version: 3.9.1
X-Python3-Version: >= 3.4 X-Python3-Version: >= 3.6
Build-Depends: debhelper (>= 9), Build-Depends: debhelper (>= 9),
dh-python, dh-python,
python3-all, python3-all,
python3-setuptools, python3-setuptools,
python3-configobj, python3-configobj,
python3-flask (>= 1.0.0),
python3-ligo-segments, python3-ligo-segments,
# -- python3-gwdatafind-server ------------------ # -- python3-gwdatafind-server ------------------
...@@ -20,6 +21,7 @@ Architecture: all ...@@ -20,6 +21,7 @@ Architecture: all
Depends: ${misc:Depends}, Depends: ${misc:Depends},
${python3:Depends}, ${python3:Depends},
python3-configobj, python3-configobj,
python3-flask (>= 1.0.0),
python3-ligo-segments python3-ligo-segments
Description: The server library for the GWDataFind service Description: The server library for the GWDataFind service
. .
......
#!/usr/bin/make -f #!/usr/bin/make -f
export PYBUILD_NAME = gwdatafind-server export PYBUILD_NAME = gwdatafind-server
export PYBUILD_DISABLE = test
%: %:
dh $@ --with python3 --buildsystem=pybuild dh $@ --with python3 --buildsystem=pybuild