forked from tailhook/vagga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvagga.yaml
156 lines (139 loc) · 4.53 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
containers:
docs:
setup:
- !Alpine v3.2
- !Install [alpine-base, py-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
HOME: /work/target
setup:
- !Ubuntu trusty
- !UbuntuUniverse
- !Install [build-essential, ca-certificates]
- !Install [file] # dependency of checkinstall (bug #46)
- !BuildDeps [cmake, libc++-dev, curl, autoconf, automake, libtool]
# Build script derived from
# https://github.com/rust-lang/rust-buildbot/blob/master/slaves/linux/build-musl.sh
- !TarInstall
url: http://www.musl-libc.org/releases/musl-1.1.11.tar.gz
script: |
./configure --prefix=/musl --disable-shared
make -j2
make install
- !Tar
url: http://llvm.org/releases/3.7.0/llvm-3.7.0.src.tar.xz
path: /tmp/llvm
- !TarInstall
url: http://llvm.org/releases/3.7.0/libunwind-3.7.0.src.tar.xz
script: |
cmake . -DLLVM_PATH=/tmp/llvm/llvm-3.7.0.src -DLIBUNWIND_ENABLE_SHARED=0
make -j2
cp lib/libunwind.a /musl/lib
- !TarInstall
url: "http://static.rust-lang.org/dist/rust-1.7.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: "http://static.rust-lang.org/dist/rust-std-1.7.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'
# For packaging
- !Install [make, checkinstall, git, uidmap, wget, gcc, libc6-dev, ca-certificates]
testbase:
setup:
- !Ubuntu trusty
- !UbuntuUniverse
- !BuildDeps [wget, git]
- !Install [make]
- !Sh |
set -ex
cd /tmp
git clone git://github.com/sstephenson/bats
cd bats
./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: |
--------------------------------------------------------
Documentation is built under docs/_build/html/index.html
make: !Command
description: Build vagga
container: rust-musl
run: [make]
make-release: !Command
description: Build vagga with optimizations
container: rust-musl
run: [make, release]
cargo: !Command
description: Run arbitrary cargo command
container: rust-musl
run: [cargo]
test-internal: !Command
description: Run rust tests of vagga
container: rust-musl
environ:
VAGGA_VERSION: v0.0.0-test
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: /usr/local/musl/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
run: |
rm target/x86_64-unknown-linux-musl/release/vagga # rebuild for sure
make release || exit 1
make ubuntu-package
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: /usr/local/musl/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
run: |
rm target/x86_64-unknown-linux-musl/debug/vagga # rebuild for sure
make all
make ubuntu-package CHECKINSTALL_FLAGS=--strip=no
make tarball
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
echo "cache-dir: /work/tmp/cache" > $HOME/.vagga.yaml
if [ -n "$UBUNTU_MIRROR" ]; then
echo "ubuntu-mirror: $UBUNTU_MIRROR" >> $HOME/.vagga.yaml
fi
if [ -n "$ALPINE_MIRROR" ]; then
echo "alpine-mirror: $ALPINE_MIRROR" >> $HOME/.vagga.yaml
fi
if [ -n "$*" ]; then
bats "$@"
else
bats tests
fi