trifid/.build.yml

34 lines
1.1 KiB
YAML
Raw Normal View History

2023-02-07 18:19:29 +00:00
image: alpine/3.17
packages:
- rust
2023-02-07 18:24:59 +00:00
- cargo
2023-02-07 18:29:10 +00:00
- openssl-dev
- postgresql
2023-02-07 18:43:27 +00:00
- sudo
2023-02-07 19:24:07 +00:00
- rust-clippy
2023-02-07 18:19:29 +00:00
sources:
- https://git.e3t.cc/~core/trifid
tasks:
- setup: |
2023-02-07 18:44:33 +00:00
sudo mkdir /run/postgresql
sudo chown postgres:postgres /run/postgresql
2023-02-07 18:43:27 +00:00
sudo -u postgres mkdir /var/lib/postgresql/data
sudo -u postgres chmod 0700 /var/lib/postgresql/data
sudo -u postgres initdb -D /var/lib/postgresql/data
sudo -u postgres pg_ctl start -D /var/lib/postgresql/data
2023-02-07 19:00:57 +00:00
cd /home/build/trifid/trifid-api
cargo install sqlx-cli
2023-02-07 18:52:42 +00:00
/home/build/.cargo/bin/sqlx database create
/home/build/.cargo/bin/sqlx mig run
2023-02-07 19:12:49 +00:00
sudo -u postgres pg_ctl stop -D /var/lib/postgresql/data
2023-02-07 18:19:29 +00:00
- check: |
2023-02-07 19:12:49 +00:00
sudo -u postgres pg_ctl start -D /var/lib/postgresql/data
2023-02-07 18:26:04 +00:00
cd /home/build/trifid
cargo check --locked
cargo clippy --locked
2023-02-07 19:12:49 +00:00
sudo -u postgres pg_ctl stop -D /var/lib/postgresql/data
2023-02-07 18:19:29 +00:00
- build: |
2023-02-07 19:12:49 +00:00
sudo -u postgres pg_ctl start -D /var/lib/postgresql/data
2023-02-07 18:26:04 +00:00
cd /home/build/trifid
2023-02-07 19:12:49 +00:00
cargo build --locked
sudo -u postgres pg_ctl stop -D /var/lib/postgresql/data