forked from swindon-rs/swindon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vagga.yaml
620 lines (576 loc) · 15.3 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
containers:
xenial:
setup:
- !Ubuntu xenial
- !UbuntuUniverse
- &pkgs !Install
- make
- gcc
- libc6-dev
- zlib1g-dev
- libssl-dev
- libcurl4-openssl-dev
- ca-certificates
- libcurl3
- pkg-config
- git # to build package
- lsb-release # to build package
- vim # to edit release notes
- &rust !TarInstall
url: https://static.rust-lang.org/dist/rust-1.38.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.38.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]
- &bulk !Tar
url: "https://github.com/tailhook/bulk/releases/download/v0.4.9/bulk-v0.4.9.tar.gz"
sha256: 23471a9986274bb4b7098c03e2eb7e1204171869b72c45385fcee1c64db2d111
path: /
- !EnsureDir /cargo
environ: &environ
CARGO_HOME: /cargo
volumes: &volumes
/cargo: !Persistent { name: cargo }
trusty:
setup:
- !Ubuntu trusty
- *pkgs
- *rust
- *bulk
- !EnsureDir /cargo
environ: *environ
volumes: *volumes
precise:
setup:
- !Ubuntu precise
- *pkgs
- *rust
- *bulk
- !EnsureDir /cargo
environ: *environ
volumes: *volumes
sphinx:
setup:
- !Alpine v3.5
- !Install [make]
- !PipConfig { dependencies: true }
- !Py2Install [sphinx]
- !Py2Requirements "docs/requirements.txt"
auto-clean: true
httpbin:
setup:
- !Alpine v3.4
- !PipConfig {dependencies: true}
- !Py3Install
- httpbin
- gunicorn
- gevent
auto-clean: true
wrk:
setup:
- !Container xenial
- !UbuntuUniverse
- !Install
- wrk
message-board: # example
setup:
- !Alpine v3.4
- !Install [ca-certificates]
- !PipConfig { dependencies: true }
- !Py3Requirements "examples/message-board/requirements.txt"
message-board2: # example
setup:
- !Alpine v3.6
- !Install [ca-certificates]
- !Install [nodejs, nodejs-npm]
- !PipConfig { dependencies: true }
- !Py3Requirements "examples/message-board2/requirements.txt"
- !NpmDependencies
file: "examples/message-board2/package.json"
environ:
NODE_PATH: /usr/lib/node_modules
presence: # example
setup:
- !Alpine v3.6
- !Install [ca-certificates]
- !Install [nodejs, nodejs-npm]
- !PipConfig { dependencies: true }
- !Py3Requirements "examples/presence/requirements.txt"
- !NpmDependencies
file: "examples/presence/package.json"
# temporary for git install
- !Sh |
cd /usr/lib/node_modules/swindon
npm install
npm run build
environ:
NODE_PATH: /usr/lib/node_modules
multi-user-chat: # example
setup:
- !Alpine v3.4
- !Install [ca-certificates]
- !PipConfig { dependencies: true }
- !Py3Requirements "examples/multi-user-chat/requirements.txt"
- !NpmDependencies
file: "examples/multi-user-chat/package.json"
environ:
NODE_PATH: /usr/lib/node_modules
multi-user-chat2: # example
setup:
- !Alpine v3.6
- !Install [ca-certificates]
- !PipConfig { dependencies: true }
- !Py3Requirements "examples/multi-user-chat2/requirements.txt"
- !NpmDependencies
file: "examples/multi-user-chat2/package.json"
environ:
NODE_PATH: /usr/lib/node_modules
pytest:
setup:
- !Ubuntu cosmic
# - !AptTrust
# keys: [4AB0F789CBA31744CC7DA76A8CF63AD3F06FC659]
# - !UbuntuPPA jonathonf/python-3.6
- !Install [libcurl4, libdw1, python3.7, python3.7-dev, ca-certificates]
- !BuildDeps
- wget
- make
- cmake
- gcc
- g++
- pkg-config
- libdw-dev
- libiberty-dev
- zlib1g-dev
- libcurl4-openssl-dev
- binutils-dev
- python3
- python3-distutils
- !TarInstall
url: https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
script: |
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
make install
- !PipConfig
dependencies: true
install-python: false
python-exe: /usr/bin/python3.7
- !Py3Requirements "tests/requirements.txt"
commands:
rustc: !Command
container: xenial
description: Run rustc command
run: [rustc]
cargo: !Command
container: xenial
symlink-name: cargo
description: Run Cargo command
run: [cargo]
make: !Command
container: xenial
description: Build project
run: [cargo, build]
cargo-test: !Command
container: xenial
description: Run CI tests (with crates in container)
environ:
RUST_BACKTRACE: 1
run: [cargo, test]
func-test: &functest !Command
container: pytest
work-dir: /work/tests
prerequisites: [make]
user-id: 1
environ:
AIOHTTP_NO_EXTENSIONS: 1
run: [pytest]
test: !Command
prerequisites: [make, cargo-test]
<<: *functest
run: &run !Command
container: xenial
description: Run
environ:
RUST_BACKTRACE: 1
run:
- cargo
- run
- --bin=swindon
- "--"
- --verbose
- --config=example.yaml
bench-run: &bench-run !Command
container: xenial
description: Run swindon for benchmarks (--release and specific config)
environ:
RUST_BACKTRACE: 1
run:
- cargo
- run
- --release
- --bin=swindon
- "--"
- --verbose
- --config=example.yaml
devd: !Command
container: xenial
description: Run swindon-dev (useless without parameters)
run:
- cargo
- run
- --bin=swindon-dev
- "--"
debug-run: !Command
container: xenial
description: Run with debugging enabled
run: |
cargo build
echo Starting...
RUST_LOG=debug exec ./target/debug/swindon --config=example.yaml
httpbin: &httpbin !Command
container: httpbin
description: Run httpbin instance
run:
- gunicorn
- httpbin:app
- -b
- example.com:5000
- --log-level
- debug
- -k
- gevent
run-with-proxy: !Supervise
description: Run swindon & httpbin
children:
httpbin: *httpbin
swindon: *run
run-two: !Supervise
description: Run two instances of swindon with replication
children:
inst1: !Command
<<: *run
run:
- cargo
- run
- --bin=swindon
- "--"
- --verbose
- --config=example-peer-A.yaml
inst2: !Command
<<: *run
run:
- cargo
- run
- --bin=swindon
- "--"
- --verbose
- --config=example-peer-B.yaml
_cargo-doc: !Command
container: xenial
description: build rust docs
environ:
CARGO_HOME: /cargo
run: |
cargo doc --no-deps
_copy-doc: !Command
container: xenial
description: copy rust docs into sphinx build dir
prerequisites: [_cargo-doc]
run: |
mkdir -p docs/_build/html
[ -d docs/_build/html/rust_api ] && rm -r docs/_build/html/rust_api
cp -rT target/doc docs/_build/html/rust_api
_cargo-new: !Command
container: xenial
description: Create New Crate lib
work-dir: /work/deps
run: [cargo, new, --vcs, git]
doc: !Command
container: sphinx
description: Build documentation
prerequisites: [_copy-doc]
epilog: |
---------------------------------------------------
Run this to open docs in browser:
xdg-open $(pwd)/docs/_build/html/index.html
work-dir: docs
run: [make, html]
wrk: !Command
container: wrk
description: Run wrk tool
run: [wrk]
example-message-board: !Supervise
description: Run swindon and message board example
prerequisites: [make]
children:
swindon: !Command
container: xenial
work-dir: examples/message-board
environ: { RUST_BACKTRACE: 1 }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon.yaml
board: !Command
container: message-board
work-dir: examples/message-board
environ:
LISTEN_FDS: 1
pass-tcp-socket: 127.0.0.1:8082
run:
- python3
- -m
- messageboard
example-message-board2: !Supervise
description: Run swindon and message board 2 example
prerequisites: [make]
children:
swindon: !Command
container: xenial
work-dir: examples/message-board2
environ: { RUST_BACKTRACE: 1, RUST_LOG: "debug,tokio_core=warn" }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon.yaml
webpack: !Command
container: message-board2
work-dir: examples/message-board2
run:
- webpack
- --watch
board: !Command
container: message-board2
work-dir: examples/message-board2
environ:
LISTEN_FDS: 1
pass-tcp-socket: 127.0.0.1:8082
run:
- python3
- -m
- messageboard
example-message-board2-two-nodes: !Supervise
description:
Run swindon and message board 2 example
employing two nodes of swindon with replication
prerequisites: [make]
children:
swindon1: !Command
container: xenial
work-dir: examples/message-board2
environ: { RUST_BACKTRACE: 1, RUST_LOG: "debug,tokio_core=warn" }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon1.yaml
swindon2: !Command
container: xenial
work-dir: examples/message-board2
environ: { RUST_BACKTRACE: 1, RUST_LOG: "debug,tokio_core=warn" }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon2.yaml
webpack: !Command
container: message-board2
work-dir: examples/message-board2
run:
- webpack
- --watch
board: !Command
container: message-board2
work-dir: examples/message-board2
environ:
LISTEN_FDS: 1
pass-tcp-socket: 127.0.0.1:8082
run:
- python3
- -m
- messageboard
example-presence: !Supervise
description: Run swindon and presence example
prerequisites: [make]
children:
swindon: !Command
container: xenial
work-dir: examples/presence
environ: { RUST_BACKTRACE: 1, RUST_LOG: "debug,tokio_core=warn" }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon.yaml
webpack: !Command
container: presence
work-dir: examples/presence
run:
- webpack
- --watch
board: !Command
container: presence
work-dir: examples/presence
environ:
LISTEN_FDS: 1
pass-tcp-socket: 127.0.0.1:8082
run:
- python3
- -m
- presence
example-presence-two-nodes: !Supervise
description:
Run swindon and presence example
employing two nodes of swindon with replication
prerequisites: [make]
children:
swindon1: !Command
container: xenial
work-dir: examples/presence
environ: { RUST_BACKTRACE: 1 }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon1.yaml
swindon2: !Command
container: xenial
work-dir: examples/presence
environ: { RUST_BACKTRACE: 1 }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon2.yaml
webpack: !Command
container: presence
work-dir: examples/presence
run:
- webpack
- --watch
board: !Command
container: presence
work-dir: examples/presence
environ:
LISTEN_FDS: 1
pass-tcp-socket: 127.0.0.1:8082
run:
- python3
- -m
- presence
example-multi-user-chat: !Supervise
description: Run swindon and multi-user-chat example
prerequisites: [make]
children:
swindon: !Command
container: xenial
work-dir: examples/multi-user-chat
environ: { RUST_BACKTRACE: 1 }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon.yaml
chat: !Command
container: multi-user-chat
work-dir: examples/multi-user-chat
run:
- python3
- -m
- muc
react-app: !Command
container: multi-user-chat
work-dir: examples/multi-user-chat
run:
- npm
- start
example-multi-user-chat2: !Supervise
description: Run swindon and multi-user-chat 2 example
prerequisites: [make]
children:
swindon: !Command
container: xenial
work-dir: examples/multi-user-chat2
environ: { RUST_BACKTRACE: 1 }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon.yaml
chat: !Command
container: multi-user-chat2
work-dir: examples/multi-user-chat2
run:
- python3
- -m
- muc
react-app: !Command
container: multi-user-chat2
work-dir: examples/multi-user-chat2
run:
- npm
- start
example-multi-user-chat2-two-nodes: !Supervise
description:
Run swindon and multi-user-chat 2 example
employing two nodes of swindon with replication
prerequisites: [make]
children:
swindon1: !Command
container: xenial
work-dir: examples/multi-user-chat2
environ: { RUST_BACKTRACE: 1 }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon1.yaml
swindon2: !Command
container: xenial
work-dir: examples/multi-user-chat2
environ: { RUST_BACKTRACE: 1 }
run:
- ../../target/debug/swindon
- --verbose
- --config=swindon2.yaml
chat: !Command
container: multi-user-chat2
work-dir: examples/multi-user-chat2
run:
- python3
- -m
- muc
react-app: !Command
container: multi-user-chat2
work-dir: examples/multi-user-chat2
run:
- npm
- start
bulk: !Command
description: Run any bulk command
container: xenial
run: [bulk]
_package-trusty: !Command
container: trusty
run: &package |
set -e
version=$(git describe --dirty)
codename=$(lsb_release --codename --short)
rm -rf pkg
rm -rf target/release/swindon*
bulk with-version "${version}" cargo install --root=/work/pkg/usr --path=.
rm pkg/usr/.crates.toml
bulk pack --package-version="${version}+${codename}1"
_package-precise: !Command
container: precise
run: *package
_package-xenial: !Command
container: xenial
run: *package
packages: !Command
container: xenial
description: Build packages and repostories (mostly for CI)
prerequisites: [_package-trusty, _package-precise, _package-xenial]
accepts_arguments: true
run: |
bulk repo-add --config bulk.yaml --repository-base dist/repos \
dist/swindon-[0-9]*.deb "$@"