28 lines
719 B
Bash
Executable file
28 lines
719 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
playwright:local() {
|
|
bash e2e/Taskfile playwright:local
|
|
}
|
|
|
|
playwright:ui() {
|
|
bash e2e/Taskfile playwright:ui
|
|
}
|
|
|
|
refresh_sqlx_db() {
|
|
rm -f some_user.db
|
|
for migration in migrations/each_user/*.sql; do
|
|
echo "Applying $migration..."
|
|
sqlite3 some_user.db < "$migration"
|
|
done
|
|
}
|
|
|
|
deploy_to_server() {
|
|
where="$1"
|
|
refresh_sqlx_db
|
|
env DATABASE_URL=sqlite:some_user.db cargo build --release
|
|
rsync -v -essh ./target/release/mascarpone "$where:~" \
|
|
&& rsync -rav -essh ./static "$where:~" \
|
|
&& ssh -t "$where" "sudo mv -f mascarpone /usr/bin/ && sudo rm -rf /var/local/mascarpone/static && sudo mv -f static /var/local/mascarpone/ && sudo systemctl restart mascarpone"
|
|
}
|
|
|
|
"$@"
|