bitque/.builds/server.yml

49 lines
1.5 KiB
YAML
Raw Normal View History

2020-05-01 22:21:28 +02:00
image: archlinux
2020-05-01 21:40:32 +02:00
packages:
- postgresql
2020-05-01 22:21:28 +02:00
- rustup
2020-05-01 21:40:32 +02:00
sources:
- https://git.sr.ht/~tsumanu/jirs
environment:
deploy: adrian.wozniak@ita-prog.pl
2020-05-02 00:12:47 +02:00
DATABASE_URL: postgres://build@localhost:5432/jirs
DEBUG: true
NODE_ENV: development
RUST_LOG: debug
JIRS_CLIENT_PORT: 7000
JIRS_CLIENT_BIND: 0.0.0.0
JIRS_SERVER_PORT: 5000
JIRS_SERVER_BIND: 0.0.0.0
2020-05-01 21:40:32 +02:00
secrets:
2021-01-07 09:13:13 +01:00
- 46f739e5-4538-45dd-a79f-bf173b7a2ed9
2020-05-01 21:40:32 +02:00
tasks:
2020-05-01 22:21:28 +02:00
- build_config: |
2020-05-02 13:13:17 +02:00
cp ~/jirs/.builds/db.toml ~/jirs/jirs-server/db.toml
cp ~/jirs/.builds/db.toml ~/jirs/jirs-server/db.test.toml
2020-05-01 21:40:32 +02:00
- setup: |
2020-05-02 00:12:47 +02:00
sudo mkdir -p /var/lib/postgres/data
sudo chown build /var/lib/postgres/data
initdb -D /var/lib/postgres/data
sudo mkdir -p /run/postgresql
sudo chown build /run/postgresql
pg_ctl -D /var/lib/postgres/data start
2020-05-01 22:21:28 +02:00
rustup toolchain install nightly
rustup default nightly
2020-05-01 21:40:32 +02:00
cargo install diesel_cli --no-default-features --features postgres
cd jirs/jirs-server
2020-05-02 00:12:47 +02:00
/home/build/.cargo/bin/diesel setup
2020-05-01 21:40:32 +02:00
- test: |
cd jirs/jirs-server
cargo test --bin jirs_server
- build: |
cd jirs
cargo build --all --release
2020-06-12 20:55:47 +02:00
strip -s ./target/release/jirs_server
2020-08-17 23:18:51 +02:00
tar -cJvf ~/server.tar.xz ./target/release/jirs_server
2020-05-01 21:40:32 +02:00
- deploy: |
2020-08-17 23:18:51 +02:00
cp ~/server.tar.xz ~/latest.tar.xz
2021-01-07 09:13:13 +01:00
scp ~/latest.tar.xz rpi.ita-prog.pl:/www/http/static/jirs-server-{TAR_NAME}.tar.xz
scp ~/latest.tar.xz rpi.ita-prog.pl:/www/http/static/jirs-server-latest.tar.xz
2020-06-12 20:55:47 +02:00
artifacts:
- jirs_server