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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
version: 2
jobs:
refresh_cache:
docker:
- image: rust:latest
steps:
- checkout
- restore_cache:
keys:
- cargo-v1-{{ checksum "Cargo.toml" }}
- run: cargo update
- run: cargo fetch
- save_cache:
key: cargo-v1-{{ checksum "Cargo.toml" }}
paths:
- /usr/local/cargo/registry
- /usr/local/cargo/git
build_stable:
docker:
- image: rust:latest
steps:
- checkout
- restore_cache:
keys:
- cargo-v1-{{ checksum "Cargo.toml" }}
- run:
name: Building Main Code
command: sh scripts/circle/build.sh
- run:
name: Building Examples
command: sh scripts/circle/build-examples.sh
- run:
name: Building Release
command: sh scripts/circle/build-release.sh
- save_cache:
key: v1-release
paths:
- ~/project/target/release
- run:
name: Test Code
command: sh scripts/circle/test.sh
build_nightly:
docker:
- image: rustlang/rust:nightly
steps:
- checkout
- restore_cache:
keys:
- cargo-v1-{{ checksum "Cargo.toml" }}
- run:
name: Nightly Version Info
command: rustc --version; cargo --version
- run:
name: Building Main Code
command: sh scripts/circle/build.sh
- run:
name: Building Examples
command: sh scripts/circle/build-examples.sh
- run:
name: Test Code
command: sh scripts/circle/test.sh
do_deploy:
docker:
- image: rust:latest
steps:
- checkout
- restore_cache:
keys:
- v1-release
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Install Docker client
command: |
set -x
VER="17.03.0-ce"
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mv /tmp/docker/* /usr/bin
# - run:
# name: Deploy Docker Container
# command: |
# sh scripts/docker/base/build.sh
# sh scripts/docker/worker/build.sh
# sh scripts/docker/console/build.sh
workflows:
version: 2
stable:
jobs:
- refresh_cache
- build_stable:
requires:
- refresh_cache
- do_deploy:
requires:
- build_stable
filters:
branches:
only: master
nightly:
jobs:
- refresh_cache
- build_nightly:
requires:
- refresh_cache