Browse Source

travis: Build Debian stable docker image and use it for testing

devuan-deployment
Paul Gevers 2 years ago
parent
commit
dbf024bf7a
No known key found for this signature in database GPG Key ID: 9C5C99EB05BD750A
4 changed files with 56 additions and 12 deletions
  1. +2
    -0
      .dockerignore
  2. +16
    -12
      .travis.yml
  3. +4
    -0
      Dockerfile
  4. +34
    -0
      ci/run-everything-and-upload-to-codecov.io.sh

+ 2
- 0
.dockerignore View File

@@ -0,0 +1,2 @@
Dockerfile
.dockerignore

+ 16
- 12
.travis.yml View File

@@ -1,25 +1,29 @@
language: c
sudo: required
dist: trusty

before_install:
# update package list
- sudo apt-get update -qq
- git clone https://anonscm.debian.org/git/collab-maint/britney2-tests.git britney2-tests
- git clone https://anonscm.debian.org/git/collab-maint/britney-tests-live-data.git britney2-tests/live-data
- rm -f .coverage

install:
# install build dependencies
- sudo apt-get install -qq --no-install-recommends python3 python3-apt python3-yaml python3-coverage python3-nose rsync libclass-accessor-perl
# Update docker-engine using Ubuntu 'trusty' apt repo
- sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
- >
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" |
sudo tee -a /etc/apt/sources.list
- sudo apt-get update
- >
sudo apt-get -o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold" --assume-yes install docker-engine
- docker version

- docker pull debian:stable
- docker build --tag=britney .

script:
- nosetests3 -v --with-coverage
- britney2-tests/bin/runtests ./ci/britney-coverage.sh britney2-tests/t test-out
- britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data
after_success:
- python3-coverage report
- python3-coverage report -m
- python3-coverage xml -i
- bash <(curl -s https://codecov.io/bash)
- docker run britney /bin/sh -c "export CI=true ; ci/run-everything-and-upload-to-codecov.io.sh"

#notifications:
# email: false

+ 4
- 0
Dockerfile View File

@@ -0,0 +1,4 @@
FROM debian:stable
WORKDIR /britney
ADD . /britney
RUN apt-get update && apt-get install --no-install-recommends --assume-yes python3 python3-apt python3-yaml python3-coverage python3-nose rsync libclass-accessor-perl libdpkg-perl curl

+ 34
- 0
ci/run-everything-and-upload-to-codecov.io.sh View File

@@ -0,0 +1,34 @@
#!/bin/bash

set -e

err=0

nosetests3 -v --with-coverage || err=$?
echo
echo
britney2-tests/bin/runtests ./ci/britney-coverage.sh britney2-tests/t test-out || err=$?
echo
echo
britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-1 live-2011-12-13 || err=$?
echo
britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-2 live-2011-12-20 || err=$?
echo
britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-3 live-2012-01-04 || err=$?
echo
britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-4 live-2012-05-09 || err=$?
echo
britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-5 live-2016-04-11 || err=$?
echo

if [ $err = 0 ] ; then
python3-coverage report || true
echo
python3-coverage report -m || true
echo
python3-coverage xml -i || true
echo
bash <(curl -s https://codecov.io/bash) || true
fi

exit $err

Loading…
Cancel
Save