-
Notifications
You must be signed in to change notification settings - Fork 52
Fix Travis & Travis Build Stages #133
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
93 changes: 0 additions & 93 deletions
.travis.sh
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
.travis/build.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash -ex | ||
|
||
# set up dependencies, etc | ||
source ./.travis/lib-setup.sh | ||
setup::install | ||
|
||
# always build in-place so that Sphinx can find the modules | ||
python setup.py build_ext --inplace | ||
BUILD_RES=$? | ||
|
||
if [ x"$KRB5_VER" = "xheimdal" ]; then | ||
# heimdal can't run the tests yet, so just exit | ||
exit $BUILD_RES | ||
fi | ||
|
||
if [ $BUILD_RES -ne 0 ]; then | ||
# if the build failed, don't run the tests | ||
exit $BUILD_RES | ||
fi | ||
|
||
python setup.py nosetests --verbosity=3 | ||
TEST_RES=$? | ||
|
||
exit $TEST_RES |
87 changes: 87 additions & 0 deletions
.travis/lib-setup.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/bash | ||
|
||
setup::python-suffix() { | ||
if [ x"$PYTHON" = "x3" ]; then | ||
echo "3" | ||
else | ||
echo "" | ||
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. | ||
|
||
setup::debian::install() { | ||
local IS3=$(setup::python-suffix) | ||
|
||
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 | ||
} | ||
|
||
setup::rh::yuminst() { | ||
# yum has no update-only verb | ||
yum -y --nogpgcheck install $@ | ||
} | ||
|
||
setup::centos::install() { | ||
local IS3=$(setup::python-suffix) | ||
|
||
# Cython on el7 is too old - downstream patches | ||
setup::rh::yuminst 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 | ||
} | ||
|
||
setup::fedora::install() { | ||
# path to binary here in case Rawhide changes it | ||
setup::rh::yuminst 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 | ||
} | ||
|
||
setup::rh::install() { | ||
setup::rh::yuminst krb5-{devel,libs,server,workstation} which gcc findutils | ||
|
||
if [ -f /etc/fedora-release ]; then | ||
setup::fedora::install | ||
else | ||
setup::centos::install | ||
fi | ||
} | ||
|
||
setup::install() { | ||
if [ -f /etc/debian_version ]; then | ||
setup::debian::install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sold on these being their own functions, but if you are then it's fine. |
||
elif [ -f /etc/redhat-release ]; then | ||
setup::rh::install | ||
else | ||
echo "Distro not found!" | ||
false | ||
fi | ||
|
||
pip install -r test-requirements.txt | ||
} | ||
|
||
setup::activate() { | ||
# remove (and restore) set -x to avoid log-spam the source | ||
# script, which we don't care about | ||
wastrace=${-//[^x]/} | ||
set +x | ||
source .venv/bin/activate | ||
if [[ -n "$wastrace" ]]; then set -x; fi | ||
} |
16 changes: 16 additions & 0 deletions
.travis/lib-util.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
util::docker-run() { | ||
local distro=1ドル | ||
shift | ||
|
||
docker run \ | ||
-v `pwd`:/tmp/build \ | ||
-w /tmp/build \ | ||
-e TRAVIS_TAG=$TRAVIS_TAG \ | ||
-e PKG_NAME_VER=$PKG_NAME_VER \ | ||
-e KRB5_VER=$KRB5_VER \ | ||
-e PYTHON=$PYTHON \ | ||
$distro \ | ||
/bin/bash -ex $@ | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.