Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Moving event type check to the top level script [docs only] [skip app…
Browse files Browse the repository at this point in the history
…veyor]
  • Loading branch information
bsipocz committed Jun 8, 2017
1 parent 5bf7a37 commit 4bbbb4f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
24 changes: 20 additions & 4 deletions travis/setup_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,36 @@
#
# The present script was added later.

if [[ $DEBUG == True ]]; then
set -x
fi

# First check: if the build should be run at all based on the event type

if [[ ! -z $EVENT_TYPE ]]; then
for event in $EVENT_TYPE; do
if [[ $TRAVIS_EVENT_TYPE = $event ]]; then
allow_to_build=True
fi
done
if [[ $allow_to_build != True ]]; then
travis_terminate 0
fi
fi

# We first check if any of the custom tags are used to skip the build
# Second check: if any of the custom tags are used to skip the build

TR_SKIP="\[(skip travis|travis skip)\]"
DOCS_ONLY="\[docs only|build docs\]"

# Skip build if the commit message contains [skip travis] or [travis skip]
# Remove workaround once travis has this feature natively
# https://github.com/travis-ci/travis-ci/issues/5032
if [[ ! -z $(echo $TRAVIS_COMMIT_MESSAGE | grep -E $TR_SKIP) ]]; then
if [[ ! -z $(echo $TRAVIS_COMMIT_MESSAGE | grep -E "$TR_SKIP") ]]; then
echo "Travis was requested to be skipped by the commit message, exiting."
travis_terminate 0
elif [[ ! -z $(echo $TRAVIS_COMMIT_MESSAGE | grep -E $DOCS_ONLY) ]]; then
if [[ $SETUP_CMD != *build_docs* ]] || [[ $SETUP_CMD != *build_sphinx* ]]; then
elif [[ ! -z $(echo $TRAVIS_COMMIT_MESSAGE | grep -E "$DOCS_ONLY") ]]; then
if [[ $SETUP_CMD != *build_docs* ]] && [[ $SETUP_CMD != *build_sphinx* ]]; then
echo "Only docs build was requested by the commit message, exiting."
travis_terminate 0
fi
Expand Down
14 changes: 1 addition & 13 deletions travis/setup_dependencies_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ hash -r

set -e

if [[ ! -z $EVENT_TYPE ]]; then
for event in $EVENT_TYPE; do
if [[ $TRAVIS_EVENT_TYPE = $event ]]; then
allow_to_build=True
fi
done
fi

if [[ $allow_to_build != True ]]; then
travis_terminate 0
fi

# We need to do this before updating conda, as $CONDA_CHANNELS may be a
# conda environment variable for some Miniconda versions, too that needs to
# be space separated.
Expand Down Expand Up @@ -429,7 +417,7 @@ fi
# cache before starting the tests/docs build. See details in
# https://github.com/matplotlib/matplotlib/issues/5836

if [[ $SETUP_CMD == build_sphinx* ]] || [[ $SETUP_CMD == build_docs* ]]; then
if [[ $SETUP_CMD == *build_sphinx* ]] || [[ $SETUP_CMD == *build_docs* ]]; then
python -c "import matplotlib.pyplot"
fi

Expand Down

0 comments on commit 4bbbb4f

Please sign in to comment.