Skip to content

Commit c6ef254

Browse files
committed
Allow the Pull Request to trigger a build.
1 parent eceaf05 commit c6ef254

2 files changed

Lines changed: 29 additions & 5 deletions

File tree

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ install:
99
- pip install ruamel.yaml
1010

1111
script:
12-
- >-
13-
git clone https://${GH_TOKEN}@github.com/cotes2020/blog-builder.git
14-
../blog-builder --depth=1 -q
15-
- cp -r ../blog-builder/framework/* .
16-
- bash _cibuild.sh
12+
- bash _scripts/travis/cibuild.sh
1713

1814
branches:
1915
only: master

_scripts/travis/cibuild.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
# Travis CI build jobs.
4+
#
5+
# © 2019 Cotes Chung
6+
# Published under MIT License
7+
8+
if [[ $TRAVIS_PULL_REQUEST = "false" ]]; then # triggered by author
9+
10+
BUILDER=../blog-builder
11+
12+
git clone https://${GH_TOKEN}@github.com/cotes2020/blog-builder.git \
13+
$BUILDER --depth=1 -q
14+
15+
cp -r $BUILDER/framework/* .
16+
bash _cibuild.sh
17+
18+
else # triggered by Pull Request
19+
20+
bundle install --path vendor/bundle --quiet
21+
python _scripts/py/init_all.py
22+
23+
build_cmd="JEKYLL_ENV=production bundle exec jekyll build"
24+
25+
echo "\$ $build_cmd"
26+
eval $build_cmd
27+
28+
fi

0 commit comments

Comments
 (0)