]> git.proxmox.com Git - rustc.git/blob - src/doc/book/ci/deploy.sh
New upstream version 1.18.0+dfsg1
[rustc.git] / src / doc / book / ci / deploy.sh
1 #!/bin/bash
2 # Copyright 2016 The Rust Project Developers. See the COPYRIGHT
3 # file at the top-level directory of this distribution and at
4 # http://rust-lang.org/COPYRIGHT.
5 #
6 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9 # option. This file may not be copied, modified, or distributed
10 # except according to those terms.
11
12 set -o errexit -o nounset
13
14 export PATH=$PATH:/home/travis/.cargo/bin;
15
16 rev=$(git rev-parse --short HEAD)
17
18 # make a scratch directory, this will correspond to
19 # https://rust-lang.github.io/book
20 mkdir book
21
22 # build the index page into it
23 rustdoc index.md -o book/
24
25 # build the first edition into it
26 mdbook build first-edition
27 mv first-edition/book book/first-edition/
28
29
30 # build the second edition into it
31 mdbook build second-edition
32 mv second-edition/book book/second-edition/
33
34 # move into the book dir and push it
35
36 cd book
37
38 git init
39 git config user.name "Steve Klabnik"
40 git config user.email "steve@steveklabnik.com"
41
42 git remote add upstream "https://$GH_TOKEN@github.com/rust-lang/book.git"
43 git fetch upstream
44 git reset upstream/gh-pages
45
46 touch .
47
48 git add -A .
49 git commit -m "rebuild pages at ${rev}"
50 git push -q upstream HEAD:gh-pages > /dev/null 2>&1