forked from rust-lang-ja/the-rust-programming-language-ja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
69 lines (64 loc) · 2.35 KB
/
circle.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
general:
branches:
ignore:
- gh-pages
machine:
timezone:
Asia/Tokyo
environment:
RUST_NIGHTLY_RELEASE_DATE: "2016-06-01"
RUST_HOME: $HOME/rust/nightly-$RUST_NIGHTLY_RELEASE_DATE
RUSTBOOK_GIT_URL: https://github.com/rust-lang-ja/rustbook.git
RUSTBOOK_GIT_BRANCH: master
PATH: $RUST_HOME/bin:$PATH
LD_LIBRARY_PATH: $RUST_HOME/lib
dependencies:
post:
- sudo apt-get update
- sudo apt-get install curl file gcc git make openssh-client
# Delete .gitconfig to prevent "cargo install" and "cargo build" from
# failing when pulling the registry info (crates.io-index).
# See https://github.com/rust-lang-ja/rust-by-example-ja/issues/38#issuecomment-238214915
# NOTE: Assuming .gitconfig only has a rewrite rule for https://github.com
- cat $HOME/.gitconfig; rm $HOME/.gitconfig
- mkdir -p $HOME/rust
# Install rustc and cargo, or use cached ones.
- ./tools/circleci/setup-rust.sh $RUST_HOME $RUST_NIGHTLY_RELEASE_DATE
- rustc --version --verbose
- cargo --version --verbose
# Install rustbook.
- cargo install --force --root $RUST_HOME --git $RUSTBOOK_GIT_URL --branch $RUSTBOOK_GIT_BRANCH
- rustbook help
cache_directories:
- "~/rust"
- "~/.cargo"
test:
override:
- make clean all VERSION=1.9
- make clean all VERSION=1.6
post:
# Save 1.9 contents as an artifact
- mkdir $CIRCLE_ARTIFACTS/1.9
- cp -p docs/1.9/index.html $CIRCLE_ARTIFACTS/1.9
- cp -rp docs/1.9/book $CIRCLE_ARTIFACTS/1.9
- cp -rp docs/1.9/*.inc docs/1.9/*.css docs/1.9/*.js $CIRCLE_ARTIFACTS/1.9
- tar cJf docs-1.9.txz docs/1.9
- mv docs-1.9.txz $CIRCLE_ARTIFACTS
# Save 1.6 contents as an artifact
- mkdir $CIRCLE_ARTIFACTS/1.6
- cp -p docs/1.6/index.html $CIRCLE_ARTIFACTS/1.6
- cp -rp docs/1.6/book $CIRCLE_ARTIFACTS/1.6
- cp -rp docs/1.6/*.inc docs/1.6/*.css docs/1.6/*.js $CIRCLE_ARTIFACTS/1.6
- tar cJf docs-1.6.txz docs/1.6
- mv docs-1.6.txz $CIRCLE_ARTIFACTS
deployment:
publish:
branch: master
commands:
- git config user.name "Tatsuya Kawano (CircleCI)"
- git config user.email "[email protected]"
# Do not publish 1.9 to gh-pages until all (or most of) the contents
# are updated from 1.6.
- rm -rf docs/1.9
- ./tools/circleci/push-to-master.sh
# - ./tools/circleci/publish-to-gh-pages.sh