1
Fork 0
mirror of https://github.com/RGBCube/Site synced 2025-07-30 12:37:50 +00:00

apply: fix script

This commit is contained in:
RGBCube 2025-06-11 16:04:13 +03:00
parent f505753a83
commit 9f92495826
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M

View file

@ -1,14 +1,18 @@
#!/usr/bin/env nu #!/usr/bin/env nu
def --wrapped sync [...arguments] { def --wrapped sync [...args] {
(rsync ( rsync
--archive
--compress --compress
--delete --recursive --force --delete --recursive --force
--delete-excluded --delete-excluded
--delete-missing-args --delete-missing-args
...$arguments)
}
--human-readable
--delay-updates
...$args)
}
# Applies the changes to the site by uploading it to the VPS. # Applies the changes to the site by uploading it to the VPS.
def main [] { def main [] {
const dest_directory = "_site_production" const dest_directory = "_site_production"
@ -29,18 +33,14 @@ def main [] {
cd $dest_directory cd $dest_directory
let host = "root@best"; let host = "root@best";
let remote_path = "/var/www/site"
ssh -tt $host " (sync
rm --force --recursive /var/www/site --chown "nginx:users"
mkdir /var/www/site --chmod "Du=rwx,Dg=rwx,Do=rx,Fu=rw,Fg=r,Fo=r" # DIRS: 775, FILES: 664
" --rsync-path $"mkdir ($remote_path); rsync"
sync --chown nginx:users ./ ($host + ":/var/www/site") ./ ($host + ":" + $remote_path))
ssh -tt $host "
chown nginx:users -R /var/www
chmod 775 -R /var/www
"
cd - cd -