forked from meihaoGit/jekyll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis
executable file
·40 lines (35 loc) · 1.13 KB
/
travis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# Usage: script/travis [ruby-version [file]]
# Example: script/travis 2.0 test/failing_test.rb
# Example: script/travis 2.3.0
set -e
mkdir -p vendor/docker
docker rm -fv docker-travis > /dev/null 2>&1 || true
docker run --volume=$(pwd):/home/travis/builds/jekyll/jekyll \
--workdir=/home/travis/builds/jekyll/jekyll \
--volume=$(pwd)/vendor/docker:/home/travis/builds/jekyll/jekyll/vendor/bundle \
--user=travis --name=docker-travis -dit quay.io/travisci/travis-ruby \
bash > /dev/null
status=0
if [ $# -eq 2 ]; then
docker exec -it docker-travis bash -ilc " \
rvm use --install --binary --fuzzy $1
bundle install --path vendor/bundle -j 12 \\
--without benchmark:site:development
bundle clean
script/test $2
" || status=$?
elif [ $# -eq 1 ]; then
docker exec -it docker-travis bash -ilc " \
rvm use --install --binary --fuzzy $1
bundle install --path vendor/bundle -j 12 \\
--without benchmark:site:development
bundle clean
bundle exec rake
" || status=$?
else
docker exec -it docker-travis \
bash -il || status=$?
fi
docker rm -fv docker-travis > /dev/null
exit $status