File tree 3 files changed +42
-3
lines changed
3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -ex
4
+
5
+ # ## Setup latest mdbook version ################################################
6
+
7
+ INSTALLED=$( echo $( mdbook --version 2> /dev/null || echo " mdbook none" ) | cut -d' ' -f1)
8
+ PINNED=0.2.1
9
+
10
+ if [ " $PINNED " != " $INSTALLED " ]; then
11
+ URL=https://github.com/rust-lang-nursery/mdBook/releases/download/v${PINNED} /mdbook-v${PINNED} -x86_64-unknown-linux-gnu.tar.gz
12
+ curl -SsL $URL | tar xvz -C $HOME /.cargo/bin
13
+ fi
14
+
15
+ # ## Build the guide ################################################################
16
+ # Build and then upload the guide to a specific folder on the gh-pages branch. This way we can have multiple versions
17
+ # of the guide at the same time (See #165)
18
+
19
+ # This builds the book in target/doc/guide. See https://github.com/rust-lang-nursery/mdBook/issues/698
20
+ mkdir -p ../target/doc
21
+ mdbook build -d ../target/doc/book
22
+
23
+ # Get the lastest tag across all branches
24
+ # https://stackoverflow.com/a/7261049/3549270
25
+ git fetch --tags
26
+ LATEST_TAG=$( git describe --tags $( git rev-list --tags --max-count=1 -l v* ) )
27
+
28
+ git clone -b gh-pages https://$AUTH_TOKEN @github.com/$TRAVIS_REPO_SLUG .git gh_pages
29
+ cd gh_pages
30
+
31
+ echo " <meta http-equiv=refresh content=0;url='${LATEST_TAG} /'>" > index.html
32
+
33
+ # For builds triggered by a tag, $TRAVIS_BRANCH will be set to the tag
34
+ rm -rf " $TRAVIS_BRANCH "
35
+ cp -r ../../target/doc/book " $TRAVIS_BRANCH "
36
+ git add --all
37
+ git commit -m " Upload documentation for $TRAVIS_BRANCH "
38
+
39
+ git push -f
File renamed without changes.
Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ services:
5
5
- docker
6
6
7
7
script :
8
- - if [ -z "$TRAVIS_TAG" ]; then ./ci/run.sh check openctf; fi
8
+ - if [ -z "$TRAVIS_TAG" ]; then ./. ci/run.sh check openctf; fi
9
9
10
10
before_deploy :
11
- - ./ci/run.sh build openctf ${TRAVIS_TAG}-${TRAVIS_OS_NAME}
11
+ - ./. ci/run.sh build openctf ${TRAVIS_TAG}-${TRAVIS_OS_NAME}
12
12
13
13
notifications :
14
14
email : false
@@ -23,7 +23,7 @@ deploy:
23
23
on :
24
24
tags : true
25
25
- provider : script
26
- script : ./ci/book.sh
26
+ script : ./. ci/book.sh
27
27
skip_cleanup : true
28
28
on :
29
29
tags : true
You can’t perform that action at this time.
0 commit comments