forked from tailhook/vagga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vagga.yaml
229 lines (207 loc) · 6.89 KB
/
vagga.yaml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
containers:
docs:
setup:
- !Alpine v3.8
- !Repo community
- !Install [alpine-base, py2-sphinx, make]
- !Py2Requirements docs/requirements.txt
rust-musl:
environ: &rustenv
LD_LIBRARY_PATH: /musl/lib/rustlib/x86_64-unknown-linux-musl/lib
PATH: /musl/bin:/usr/local/bin:/usr/bin:/bin
setup:
- !Ubuntu focal
- !UbuntuUniverse
- !Install [build-essential, ca-certificates, cmake, zlib1g-dev]
- !Install [file] # dependency of checkinstall (bug #46)
- !TarInstall
url: "https://static.rust-lang.org/dist/rust-1.57.0-x86_64-unknown-linux-gnu.tar.gz"
script: "./install.sh --prefix=/usr --components=rustc,rust-std-x86_64-unknown-linux-gnu,cargo"
- !TarInstall
url: "https://static.rust-lang.org/dist/rust-std-1.57.0-x86_64-unknown-linux-musl.tar.gz"
script: "./install.sh --prefix=/musl \
--components=rust-std-x86_64-unknown-linux-musl"
- !Sh 'ln -s /musl/lib/rustlib/x86_64-unknown-linux-musl /usr/lib/rustlib/x86_64-unknown-linux-musl'
- !Install [musl-tools]
- !TarInstall
url: "https://static.rust-lang.org/dist/rust-std-1.57.0-wasm32-unknown-unknown.tar.gz"
script: "./install.sh --prefix=/usr --components=rust-std-wasm32-unknown-unknown"
- &bulk !Tar
url: "https://github.com/tailhook/bulk/releases/download/v0.4.9/bulk-v0.4.9.tar.gz"
sha256: 23471a9986274bb4b7098c03e2eb7e1204171869b72c45385fcee1c64db2d111
path: /
- !EnsureDir /root/.cargo
# For packaging
- !Install [make, checkinstall, git, uidmap, wget, gcc, libc6-dev, ca-certificates]
volumes:
/root/.cargo: !CacheDir cargo
musleabihf:
setup:
- !Ubuntu focal
- !UbuntuUniverse
- !Text
/etc/apt/sources.list.d/arm.list: |
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports focal universe
- !Install
- build-essential
- git
- ca-certificates
- cmake
- zlib1g-dev
- gcc-arm-linux-gnueabihf
- g++-arm-linux-gnueabihf
- !Sh dpkg --add-architecture armhf
- !Install [musl-dev:armhf]
- !TarInstall
url: "https://static.rust-lang.org/dist/rust-1.57.0-x86_64-unknown-linux-gnu.tar.gz"
script: "./install.sh --prefix=/usr --components=rustc,rust-std-x86_64-unknown-linux-gnu,cargo"
- !TarInstall
url: "https://static.rust-lang.org/dist/rust-std-1.57.0-arm-unknown-linux-musleabihf.tar.gz"
script: "./install.sh --prefix=/usr \
--components=rust-std-arm-unknown-linux-musleabihf"
- !EnsureDir /root/.cargo
volumes:
/root/.cargo: !CacheDir cargo
testbase:
setup:
- !Ubuntu focal
- !UbuntuUniverse
- !BuildDeps [wget]
- !Install [make, curl, zip, file, git, ca-certificates, parallel]
- !Sh |
set -ex
cd /tmp
git clone --depth=1 https://github.com/bats-core/bats-core
git clone --depth=1 https://github.com/bats-core/bats-support /bats/bats-support
git clone --depth=1 https://github.com/bats-core/bats-assert /bats/bats-assert
cd bats-core
./install.sh /usr
test:
setup:
- !Container testbase
- !Depends vagga
- !Depends apk
- !Depends busybox
- !Depends alpine-keys.apk
- !Sh make install
auto-clean: true
commands:
print-env: !Command
container: docs
run: [env]
doc: !Command
description: Build vagga documentation
container: docs
run: [make, html]
work-dir: docs
epilog: |
--------------------------------------------------------
xdg-open docs/_build/html/index.html
make: !Command
description: Build vagga
container: rust-musl
run: [make]
make-no-containers: !Command
description: Build no-containers build of vagga
container: rust-musl
environ:
VAGGA_VERSION: v0.0.0-dev
run: |
set -ex
cargo build --target=x86_64-unknown-linux-musl \
--no-default-features --features=config_runner
cp --remove-destination target/x86_64-unknown-linux-musl/debug/vagga \
./vagga-no-containers
make-release: !Command
description: Build vagga with optimizations
container: rust-musl
run: [make, release]
make-test: !Command
description: Build vagga for tests
container: rust-musl
run: [make, build-test]
make-arm: !Command
description: Cross-compile vagga for arm
container: musleabihf
environ:
CFLAGS: -I/usr/include/arm-linux-musleabihf
CC: arm-linux-gnueabihf-gcc
run: |
export VAGGA_VERSION=$(git describe)
exec cargo rustc --target=arm-unknown-linux-musleabihf -- -C linker="arm-linux-gnueabihf-gcc"
cargo: !Command
description: Run arbitrary cargo command
container: rust-musl
symlink-name: cargo
environ:
VAGGA_VERSION: v0.0.0-test
RUST_BACKTRACE: 1
run: [cargo]
test-internal: !Command
description: Run rust tests of vagga
container: rust-musl
environ:
VAGGA_VERSION: v0.0.0-test
RUST_BACKTRACE: 1
run: [cargo, test]
build-packages: !Command
description: Create an ubuntu (.deb) package using checkinstall in
container and tar.gz. Both put into `dist/`
container: rust-musl
write-mode: transient-hard-link-copy
environ:
PATH: /musl/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
run: |
set -ex
rm target/x86_64-unknown-linux-musl/release/vagga || true # force rebuild
make release
make ubuntu-package CHECKINSTALL_FLAGS=--strip=no
make tarball
build-packages-testing: !Command
description: Same as build-packages but with debugging info enabled
container: rust-musl
write-mode: transient-hard-link-copy
environ:
PATH: /musl/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
run: |
set -ex
rm target/x86_64-unknown-linux-musl/debug/vagga || true # force rebuild
make all
make ubuntu-package CHECKINSTALL_FLAGS=--strip=no
make tarball
_package: !Command
description: Create a new kind of package with bulk
container: rust-musl
run: |
set -ex
version="$(git describe --dirty)"
rm -rf dist/pkg
rm target/x86_64-unknown-linux-musl/release/vagga || true # force rebuild
bulk with-version $version \
make release
DESTDIR=dist/pkg ./install.sh
bulk with-version $version \
bulk pack --dir dist/pkg
test: !Command
description: Run self tests
container: test
accepts-arguments: true
run: |
set -ex
rm -rf tests/*/.vagga
export HOME=/work/tmp/home
mkdir -p $HOME /work/tmp/cache || true
export VAGGA_SETTINGS="
build-lock-wait: true
cache-dir: /work/tmp/cache
ubuntu-mirror: $UBUNTU_MIRROR
alpine-mirror: $ALPINE_MIRROR"
if [ -n "$*" ]; then
bats "$@"
else
bats tests
fi
_bulk: !Command
description: Run any bulk command
container: rust-musl
run: [bulk]