hash statics
This commit is contained in:
parent
a45bf45015
commit
d925573629
12 changed files with 139 additions and 1464 deletions
23
Taskfile
23
Taskfile
|
|
@ -16,18 +16,31 @@ refresh_sqlx_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"
|
||||
refresh_sqlx_db
|
||||
env DATABASE_URL=sqlite:some_user.db cargo build --release
|
||||
_cargo build --release
|
||||
rsync -v -essh ./target/release/mascarpone "$where:~" \
|
||||
&& rsync -rav -essh ./static "$where:~" \
|
||||
&& rsync -rav -essh ./hashed_static "$where:~/static" \
|
||||
&& 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"
|
||||
}
|
||||
|
||||
dev() {
|
||||
refresh_sqlx_db > /dev/null
|
||||
env DATABASE_URL=sqlite:some_user.db cargo run -- serve
|
||||
_cargo run -- serve
|
||||
}
|
||||
|
||||
"$@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue