2019-03-31 11:00:21 +00:00
|
|
|
#!/usr/bin/env rake
|
|
|
|
|
|
|
|
require 'find'
|
|
|
|
|
|
|
|
desc 'Deploy the hugo contents to the server'
|
2021-03-06 11:34:50 +00:00
|
|
|
task :stag => [:init, :prep, :tcard] do
|
2020-04-18 15:00:23 +00:00
|
|
|
sh 'hugo -e staging -v --minify'
|
2019-06-29 08:25:33 +00:00
|
|
|
|
2019-03-31 11:00:21 +00:00
|
|
|
sh 'find public -type f -name "*.gz" -delete'
|
|
|
|
|
2020-05-01 05:30:30 +00:00
|
|
|
sh 'find public/ -type f | egrep "\.(css|js|png|jpg|html|JPG|PNG|CSS|JS|HTML)$" | xargs -n 1 -i% -P 0 sh -c "cp % %.bk && gzip % && mv %.bk %"'
|
2019-03-31 11:00:21 +00:00
|
|
|
|
2020-01-05 11:06:49 +00:00
|
|
|
sh 'ssh -p 10022 webadm@10.0.1.166 "rm -rf /var/www/test/*"'
|
2023-08-20 11:00:04 +00:00
|
|
|
sh 'rsync -e "ssh -p 10022" -rltvz --omit-dir-times --delete public/ webadm@10.0.1.222:/var/www/test'
|
2019-03-31 11:00:21 +00:00
|
|
|
end
|