49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
image: archlinux
|
|
packages:
|
|
- postgresql
|
|
- rustup
|
|
sources:
|
|
- https://git.sr.ht/~tsumanu/jirs
|
|
environment:
|
|
deploy: adrian.wozniak@ita-prog.pl
|
|
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
|
|
secrets:
|
|
- 46f739e5-4538-45dd-a79f-bf173b7a2ed9
|
|
tasks:
|
|
- build_config: |
|
|
cp ~/jirs/.builds/db.toml ~/jirs/jirs-server/db.toml
|
|
cp ~/jirs/.builds/db.toml ~/jirs/jirs-server/db.test.toml
|
|
- setup: |
|
|
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
|
|
rustup toolchain install nightly
|
|
rustup default nightly
|
|
cargo install diesel_cli --no-default-features --features postgres
|
|
cd jirs/jirs-server
|
|
/home/build/.cargo/bin/diesel setup
|
|
- test: |
|
|
cd jirs/jirs-server
|
|
cargo test --bin jirs_server
|
|
- build: |
|
|
cd jirs
|
|
cargo build --all --release
|
|
strip -s ./target/release/jirs_server
|
|
tar -cJvf ~/server.tar.xz ./target/release/jirs_server
|
|
- deploy: |
|
|
cp ~/server.tar.xz ~/latest.tar.xz
|
|
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
|
|
artifacts:
|
|
- jirs_server
|