2026-05-30 12:15:04 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2026-05-31 22:02:32 -05:00
|
|
|
fetch_3p_scripts() {
|
|
|
|
|
curl "https://cdn.jsdelivr.net/npm/htmx-ext-response-targets@2.0.4" -o "static/htmx-ext-response-targets_2.0.4.min.js"
|
|
|
|
|
curl "https://cdn.jsdelivr.net/npm/htmx.org@2.0.7/dist/htmx.min.js" -o "static/htmx_2.0.7.min.js"
|
|
|
|
|
curl "https://cdn.jsdelivr.net/npm/alpinejs@3.15.12/dist/cdn.min.js" -o "static/alpine_3.15.12.min.js"
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-30 12:15:04 -05:00
|
|
|
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..."
|
|
|
|
|
echo "BEGIN TRANSACTION;$(cat "$migration");COMMIT TRANSACTION;"\
|
|
|
|
|
| sqlite3 some_user.db
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_env() {
|
|
|
|
|
refresh_sqlx_db > /dev/null
|
|
|
|
|
DATABASE_URL=sqlite:some_user.db \
|
|
|
|
|
CACHE_BUST_ASSETS_DIR=static \
|
|
|
|
|
"$@"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_cargo() {
|
|
|
|
|
_env cargo "$@"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
edit() {
|
|
|
|
|
_env nvim
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
deploy_to_server() {
|
|
|
|
|
where="$1"
|
|
|
|
|
_cargo build --release
|
|
|
|
|
rsync -v -essh ./target/release/entretien "$where:~" \
|
|
|
|
|
&& rsync -rav -essh ./hashed_static "$where:~/" \
|
|
|
|
|
&& ssh -t "$where" "sudo mv -f entretien /usr/bin/ && sudo rm -rf /var/local/entretien/hashed_static && sudo mv -f hashed_static /var/local/entretien/ && sudo systemctl restart entretien"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dev() {
|
|
|
|
|
find src static migrations | entr -ccdr ./Taskfile _cargo run -- serve "$@"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
release() {
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
bash e2e/Taskfile playwright:ci
|
|
|
|
|
_cargo test
|
|
|
|
|
new_tag=$(git-cliff --unreleased --bumped-version)
|
|
|
|
|
git tag -m "$new_tag" "$new_tag"
|
|
|
|
|
cargo set-version "${new_tag#v}"
|
|
|
|
|
mv CHANGELOG.md CHANGELOG.old
|
|
|
|
|
cat <(git cliff) <(printf "\n") CHANGELOG.old > CHANGELOG.md
|
|
|
|
|
rm CHANGELOG.old
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
"$@"
|