-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
66 lines (57 loc) · 1.75 KB
/
Makefile
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
#!make
SHELL = /bin/bash
define write-env =
touch .env
grep -q '^TRANSCODE=' .env || echo 'TRANSCODE=true' >> .env
grep -q '^YT_API_KEY=' .env || echo 'YT_API_KEY=' >> .env
grep -q '^TWITCH_SECRET=' .env || echo 'TWITCH_SECRET=' >> .env
grep -q '^TWITCH_CLIENT_ID=' .env || echo 'TWITCH_CLIENT_ID=' >> .env
grep -q '^RUST_LOG=' .env || echo 'RUST_LOG=DEBUG' >> .env
grep -q '^MP3_BITRATE=' .env || echo 'MP3_BITRATE=192' >> .env
grep -q '^SUBFOLDER=' .env || echo 'SUBFOLDER=/' >> .env
grep -q '^REDIS_ADDRESS=' .env || echo 'REDIS_ADDRESS=localhost' >> .env
grep -q '^REDIS_PORT=' .env || echo 'REDIS_PORT=6379' >> .env
endef
ifneq (,$(wildcard ./.env))
include .env
export
endif
install-ubuntu-deps:
$(write-env)
sudo apt update
sudo apt install -y ffmpeg python3-pip redis
echo installing rust + cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "${HOME}/.cargo/env"
cargo install cargo-watch
pip3 install yt-dlp
install-fedora-deps:
$(write-env)
sudo dnf update
sudo dnf install -y ffmpeg python3-pip redis
echo installing rust + cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "${HOME}/.cargo/env"
cargo install cargo-watch
pip3 install yt-dlp
start-deps:
@if which docker-compose >/dev/null; then \
sudo docker-compose -f docker-compose.dev_enviroment.yml up --force-recreate -d; \
else \
sudo docker compose -f docker-compose.dev_enviroment.yml up --force-recreate -d; \
fi
image:
@if which docker-compose >/dev/null; then \
sudo docker-compose build; \
else \
sudo docker compose build; \
fi
test:
cargo test -- --nocapture
test-watch:
cargo watch "test -- --nocapture"
run:
redis-cli flushdb
cargo run
hot-reload:
cargo watch -s "redis-cli flushdb && cargo run"