-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJustfile
62 lines (45 loc) · 1.69 KB
/
Justfile
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
set dotenv-load := true
set positional-arguments
just := quote(just_executable())
this := just + " -f " + quote(justfile())
server := env_var('DEPLOY_USER') + "@" + env_var('DEPLOY_HOST')
path := env_var_or_default("DEPLOY_PATH", "/srv/rustify")
generate:
sea-orm-cli generate entity -o src/entity.example --expanded-format
validate:
cargo clippy
cargo test
ansible-lint .infra/ansible/playbook.yml
fix:
cargo fmt
cargo clippy --fix --allow-dirty --allow-staged
ansible-lint --write .infra/ansible/playbook.yml
get-db:
scp "{{ server }}:{{ path }}/var/data.db" "var/data.db"
scp "{{ server }}:{{ path }}/var/data.db-shm" "var/data.db-shm"
scp "{{ server }}:{{ path }}/var/data.db-wal" "var/data.db-wal"
upload-db:
ssh "{{ server }}" -- mkdir -p "{{ path }}/var"
rsync -P -e ssh "var/data.db" "{{ server }}:{{ path }}/var/data.db"
rsync -P -e ssh "var/data.db-shm" "{{ server }}:{{ path }}/var/data.db-shm"
rsync -P -e ssh "var/data.db-wal" "{{ server }}:{{ path }}/var/data.db-wal"
compose +args:
ssh "{{ server }}" -- docker-compose -f "{{ path }}/docker-compose.yml" {{ args }}
logs:
{{ this }} compose logs -f
ssh:
ssh -t "{{ server }}" "cd {{ path }}; bash --login"
restart:
ssh "{{ server }}" -- docker-compose --project-directory "{{ path }}" restart bot track_check queues
run-bot:
proxychains4 -q cargo run --bin "bot"
run-track-check:
proxychains4 -q cargo run --bin "track_check"
run-queues:
proxychains4 -q cargo run --bin "queues"
run-metrics:
proxychains4 -q cargo run --bin "metrics"
run:
parallel --tagstring "[{}]" --line-buffer -j4 --halt now,fail=1 just ::: "run-bot" "run-track-check" "run-metrics" "run-queues"
watch:
cargo watch -s 'just run'