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

Test unbreaking travis through docker #109

Merged
merged 1 commit into from
Apr 17, 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
4 changes: 4 additions & 0 deletions .travis.before-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh

source ./.venv/bin/activate

yum -y install tar coreutils git

# build the docs
# the first run is for the docs build, so don't clean up
pip install -r docs-requirements.txt
Expand Down
23 changes: 0 additions & 23 deletions .travis.install.sh

This file was deleted.

52 changes: 51 additions & 1 deletion .travis.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,54 @@
#!/bin/sh -x
#!/bin/bash -ex

if [ x"$PYTHON" = "x3" ]; then
IS3="3"
else
IS3=""
fi

# We test Debian's cython. el7's cython is too old, and Rawhide's virtualenv
# doesn't work right (usrmerge bugs) so we can only test Debian's cython.

if [ -f /etc/debian_version ]; then
export DEBIAN_FRONTEND=noninteractive
apt-get update

if [ x"$KRB5_VER" = "xheimdal" ]; then
apt-get -y install heimdal-dev
else
apt-get -y install krb5-{user,kdc,admin-server,multidev} libkrb5-dev
fi

apt-get -y install gcc virtualenv python$IS3-{virtualenv,dev} cython$IS3

virtualenv --system-site-packages -p $(which python${PYTHON}) .venv
source ./.venv/bin/activate
elif [ -f /etc/redhat-release ]; then
# yum has no update-only verb

yum -y install krb5-{devel,libs,server,workstation} which gcc findutils

if [ -f /etc/fedora-release ]; then
# path to binary here in case Rawhide changes it
yum install -y redhat-rpm-config \
/usr/bin/virtualenv python${PYTHON}-{virtualenv,devel}
virtualenv -p $(which python${PYTHON}) .venv
source ./.venv/bin/activate
pip install --install-option='--no-cython-compile' cython
else
# Cython on el7 is too old - downstream patches
yum install -y python$IS3-{virtualenv,devel}
virtualenv -p $(which python$IS3) .venv
source ./.venv/bin/activate
pip install --upgrade pip # el7 pip doesn't quite work right
pip install --install-option='--no-cython-compile' cython
fi
else
echo "Distro not found!"
false
fi

pip install -r test-requirements.txt

# always build in-place so that Sphinx can find the modules
python setup.py build_ext --inplace
Expand Down
61 changes: 34 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
language: python
python:
- "2.7"
- "3.5"
sudo: required

env:
- KRB5_VER="1.10"
- KRB5_VER="1.12"
- KRB5_VER="1.13"
# - KRB5_VER="master"
# not necessary, but less confusing if defined
language: python

matrix:
exclude:
- python: "3.5"
env: KRB5_VER="1.10"
include:
- python: "3.3"
env: KRB5_VER="1.12"
- python: "3.4"
env: KRB5_VER="1.13"
- python: "3.5"
env: KRB5_VER="heimdal"
services:
- docker

install: sh -ex .travis.install.sh
env:
- DISTRO=debian:stable PYTHON="2"
- DISTRO=debian:stable PYTHON="3" # 3.4, not 3.5
- DISTRO=debian:stable PYTHON="3" KRB5_VER="heimdal"
- DISTRO=centos:7 PYTHON="2" # el7 doesn't do python3 modules
- DISTRO=fedora:rawhide PYTHON="3"
- DISTRO=fedora:rawhide PYTHON="2"

script: sh -x .travis.sh
script:
- sudo sed -i '1i 127.0.0.1 test.box' /etc/hosts
- sudo hostname test.box
- >
docker run
-v `pwd`:/tmp/build
-w /tmp/build
-e KRB5_VER=$KRB5_VER
-e PYTHON=$PYTHON
$DISTRO
/bin/bash -ex .travis.sh

before_deploy: sh -x .travis.before-deploy.sh
before_deploy:
- >
docker run
-v `pwd`:/tmp/build
-w /tmp/build
-e TRAVIS_TAG=$TRAVIS_TAG
-e PKG_NAME_VER=$PKG_NAME_VER
$DISTRO
/bin/sh -x .travis.before-deploy.sh
deploy:
- provider: releases
api_key:
Expand All @@ -36,8 +45,7 @@ deploy:
on:
repo: pythongssapi/python-gssapi
tags: true
python: "3.5"
condition: "$KRB5_VER = '1.13'"
condition: "$DISTRO = 'fedora:rawhide' && $PYTHON = '3'"
skip_cleanup: true
- provider: pypi
user:
Expand All @@ -47,7 +55,6 @@ deploy:
on:
repo: pythongssapi/python-gssapi
tags: true
python: "3.5"
condition: "$KRB5_VER = '1.13'"
condition: "$DISTRO = 'fedora:rawhide' && $PYTHON = '3'"
skip_cleanup: true
docs_dir: travis_docs_build/html