Skip to content

Commit b75f03c

Browse files
committed
Introduce build switching structure
1 parent db879d2 commit b75f03c

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

.travis.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ env:
1616
- TRANSIFEX_PROJECT=python-newest
1717
# Directory where repositories are cloned
1818
- BASEDIR="$(dirname ${TRAVIS_BUILD_DIR})"
19-
before_install:
20-
- bash ${TRAVIS_BUILD_DIR}/scripts/before_install_3.7
19+
# Number of parent commits
20+
- NUM_PARENTS=$(git log --pretty=%P -n 1 HEAD | awk '{ print NF }')
2121
install:
22-
- pip install sphinx
23-
- pip install blurb
24-
- pip install transifex-client
25-
- pip install sphinx-intl
22+
- pip install sphinx
23+
- pip install blurb
24+
- pip install transifex-client
25+
- pip install sphinx-intl
26+
before_script:
27+
- build_type=$(bash ${TRAVIS_BUILD_DIR}/scripts/determine-build-type)
2628
script:
27-
# upload-catalog
28-
- bash ${TRAVIS_BUILD_DIR}/scripts/upload-catalog
29-
# renew-catalog-template
30-
- bash ${TRAVIS_BUILD_DIR}/scripts/renew-catalog-template
29+
- bash ${TRAVIS_BUILD_DIR}/scripts/${build_type}/prepare-build_3.7
30+
- bash ${TRAVIS_BUILD_DIR}/scripts/${build_type}/upload-catalog
31+
- bash ${TRAVIS_BUILD_DIR}/scripts/${build_type}/renew-catalog-template

scripts/determine-build-type

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -eux
3+
4+
if [[ "${TRAVIS_EVENT_TYPE}" == "push" ]]; then
5+
if [[ ${NUM_PARENTS} == 1 ]]; then
6+
echo push
7+
else
8+
echo pr-merge
9+
fi
10+
elif [[ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]]; then
11+
echo pr
12+
elif [[ "${TRAVIS_EVENT_TYPE}" == "cron" ]]; then
13+
echo push
14+
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)