This repository was archived by the owner on Jan 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathvagga.yaml
More file actions
79 lines (73 loc) · 3.06 KB
/
Copy pathvagga.yaml
File metadata and controls
79 lines (73 loc) · 3.06 KB
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
minimum-vagga: v0.6.0
containers:
postgres:
environ:
PG_PORT: 5432
PG_DB: hazel
PG_USER: postgres
PG_PASSWORD: postgr3s
PGDATA: /data
PG_BIN: /usr/lib/postgresql/9.5/bin
volumes:
/data: !Persistent { name: postgres.data }
setup:
- !Ubuntu xenial
- !Install [postgresql-9.5]
- !EnsureDir /data
auto-clean: true
rust:
auto-clean: true
environ:
HOME: /work/target
setup:
- !Ubuntu xenial
- !UbuntuUniverse
- !Install [build-essential, ca-certificates, pkg-config, file, openssl, libssl-dev, libpq-dev, libldap2-dev, liblzma-dev]
- !TarInstall
url: "https://static.rust-lang.org/dist/rust-1.9.0-x86_64-unknown-linux-gnu.tar.gz"
script: "./install.sh --prefix=/usr --components=rustc,rust-std-x86_64-unknown-linux-gnu,cargo"
commands:
database: &database !Command
description: Run hazeldb postgresql server
container: postgres
run: |
chown postgres:postgres $PGDATA;
if [ -z $(ls -A $PGDATA) ]; then
su postgres -c "$PG_BIN/pg_ctl initdb";
su postgres -c "echo 'host all all all trust' >> $PGDATA/pg_hba.conf"
su postgres -c "$PG_BIN/pg_ctl -w -o '-F --port=$PG_PORT -k /tmp' start";
su postgres -c "$PG_BIN/psql -h 127.0.0.1 -p $PG_PORT -c \"ALTER USER $PG_USER WITH PASSWORD '$PG_PASSWORD';\""
su postgres -c "$PG_BIN/createdb -h 127.0.0.1 -p $PG_PORT $PG_DB -O $PG_USER";
else
su postgres -c "$PG_BIN/pg_ctl -w -o '-F --port=$PG_PORT -k /tmp' start";
fi
while [ ! -f /work/.dbcreation ]; do sleep 0.2; done
rm /work/.dbcreation # Release lock
sleep infinity
psql: !Supervise
description: Access the test database with psql
children:
psql: !Command
container: postgres
run: |
touch /work/.dbcreation # Create lock file
while [ -f /work/.dbcreation ]; do sleep 0.2; done # Acquire lock
psql postgres://$PG_USER:$PG_PASSWORD@127.0.0.1/$PG_DB
db: *database
build: !Command
description: Build hazel with rust stable
container: rust
run: |
cargo install --git https://github.com/mmstick/cargo-deb/
cargo build --no-default-features --features stable --release
cargo deb --no-build
run: !Supervise
description: Run hazel with empty postgresql server
children:
hazel: !Command
container: rust
run: |
touch /work/.dbcreation # Create lock file
while [ -f /work/.dbcreation ]; do sleep 0.2; done # Acquire lock
cargo run --no-default-features --features stable --release -- -d postgres://postgres:postgr3s@localhost/hazel
db: *database