Browse Source

Refactor deployment script

main
Mark Cornick 2 months ago
parent
commit
bcd140eb4a
  1. 1
      config-en.toml
  2. 85
      deploy.sh

1
config-en.toml

@ -0,0 +1 @@
config.toml

85
deploy.sh

@ -1,59 +1,64 @@
#!/bin/bash -e
export TZ=UTC
build_rsync_www() {
printf "%s... " "${1}"
deploy_www() {
printf "%s... " "$1"
rm -rf public
hugo --quiet --minify --baseURL "$1"
rsync --exclude "gemini" -a public/ "$2" >/dev/null 2>&1
printf "done\n"
}
build_rsync_www_es() {
printf "%s... " "${1}"
rm -rf public
hugo --config config-es.toml --quiet --minify --baseURL "$1"
rsync --exclude "gemini" -a public/ "$2" >/dev/null 2>&1
hugo --config "config-$3.toml" --quiet --minify --baseURL "$1"
case "$4" in
rsync)
rsync --exclude "gemini" -a public/ "$2" >/dev/null 2>&1
;;
rclone)
rm -rf public/gemini public/**/gemini
rclone copy public/ "$2"
;;
*)
true
;;
esac
printf "done\n"
}
build_rsync_gemini() {
printf "%s... " "${1}"
deploy_gemini() {
printf "%s... " "$1"
rm -rf public
hugo --quiet --minify --baseURL "$1"
mv public/blog/gemini/index.gmi public/gemini/blog/index.gmi
mv public/show/gemini/index.gmi public/gemini/show/index.gmi
cp static/pgpkey.txt public/gemini
rsync -a public/gemini/ "$2" >/dev/null 2>&1
case "$4" in
rsync)
rsync -a public/gemini/ "$2" >/dev/null 2>&1
;;
*)
true
;;
esac
printf "done\n"
}
printf "https://markcornick.com/... "
rm -rf public
hugo --quiet --minify --baseURL https://markcornick.com/
rclone copy public/ fastmail:
printf "done\n"
build_rsync_www https://aussies.space/~mcornick/ mcornick@aussies.space:/home/mcornick/public_html
build_rsync_www https://bsd.tilde.team/~mcornick/ mcornick@bsd.tilde.team:/home/mcornick/public_html
build_rsync_www https://ctrl-c.club/~mcornick/ mcornick@ctrl-c.club:/home/mcornick/public_html
build_rsync_www https://envs.net/~mcornick/ mcornick@envs.net:/home/mcornick/public_html
build_rsync_www https://mcornick.tilde.institute/ mcornick@tilde.institute:/home/mcornick/public_html
build_rsync_www_es https://texto-plano.xyz/~mcornick/ mcornick@texto-plano.xyz:/home/mcornick/public_html
build_rsync_www https://thunix.net/~mcornick/ mcornick@thunix.net:/home/mcornick/public_html
build_rsync_www https://tilde.club/~mcornick/ mcornick@tilde.club:/home/mcornick/public_html
build_rsync_www https://tilde.team/~mcornick/ mcornick@tilde.team:/home/mcornick/public_html
build_rsync_www https://yourtilde.com/~mcornick/ mcornick@yourtilde.com:/home/mcornick/public_html
build_rsync_www https://mcornick.sdf.org/ mcornick@ma.sdf.org:/meta/m/mcornick/html
deploy_www https://markcornick.com/ fastmail: en rclone
deploy_www https://aussies.space/~mcornick/ mcornick@aussies.space:/home/mcornick/public_html en rsync
deploy_www https://bsd.tilde.team/~mcornick/ mcornick@bsd.tilde.team:/home/mcornick/public_html en rsync
deploy_www https://ctrl-c.club/~mcornick/ mcornick@ctrl-c.club:/home/mcornick/public_html en rsync
deploy_www https://envs.net/~mcornick/ mcornick@envs.net:/home/mcornick/public_html en rsync
deploy_www https://mcornick.tilde.institute/ mcornick@tilde.institute:/home/mcornick/public_html en rsync
deploy_www https://texto-plano.xyz/~mcornick/ mcornick@texto-plano.xyz:/home/mcornick/public_html es rsync
deploy_www https://thunix.net/~mcornick/ mcornick@thunix.net:/home/mcornick/public_html en rsync
deploy_www https://tilde.club/~mcornick/ mcornick@tilde.club:/home/mcornick/public_html en rsync
deploy_www https://tilde.team/~mcornick/ mcornick@tilde.team:/home/mcornick/public_html en rsync
deploy_www https://yourtilde.com/~mcornick/ mcornick@yourtilde.com:/home/mcornick/public_html en rsync
deploy_www https://mcornick.sdf.org/ mcornick@ma.sdf.org:/meta/m/mcornick/html en rsync
ssh mcornick@ma.sdf.org mkhomepg -p >/dev/null 2>&1
build_rsync_www https://mcornick.sdf.org/ mcornick@sdf.org:/sdf/arpa/gm/m/mcornick/html
build_rsync_www https://mcornick.com/ mcornick@sdf.org:/sdf/arpa/gm/m/mcornick/html/mcornick.com
deploy_www https://mcornick.sdf.org/ mcornick@sdf.org:/sdf/arpa/gm/m/mcornick/html en rsync
deploy_www https://mcornick.com/ mcornick@sdf.org:/sdf/arpa/gm/m/mcornick/html/mcornick.com en rsync
ssh mcornick@sdf.org mkhomepg -p >/dev/null 2>&1
build_rsync_gemini gemini://gemini.ctrl-c.club/~mcornick/ mcornick@ctrl-c.club:/home/mcornick/public_gemini
build_rsync_gemini gemini://envs.net/~mcornick/ mcornick@envs.net:/home/mcornick/public_gemini
build_rsync_gemini gemini://tilde.pink/~mcornick/ mcornick@tilde.pink:/home/mcornick/public_gemini
build_rsync_gemini gemini://tilde.team/~mcornick/ mcornick@tilde.team:/home/mcornick/public_gemini
build_rsync_gemini gemini://gem.sdf.org/mcornick/ mcornick@ma.sdf.org:/meta/m/mcornick/gemini
build_rsync_gemini gemini://sdf.org/mcornick/ mcornick@sdf.org:/sdf/arpa/gm/m/mcornick/gopher
deploy_gemini gemini://gemini.ctrl-c.club/~mcornick/ mcornick@ctrl-c.club:/home/mcornick/public_gemini en rsync
deploy_gemini gemini://envs.net/~mcornick/ mcornick@envs.net:/home/mcornick/public_gemini en rsync
deploy_gemini gemini://tilde.pink/~mcornick/ mcornick@tilde.pink:/home/mcornick/public_gemini en rsync
deploy_gemini gemini://tilde.team/~mcornick/ mcornick@tilde.team:/home/mcornick/public_gemini en rsync
deploy_gemini gemini://gem.sdf.org/mcornick/ mcornick@ma.sdf.org:/meta/m/mcornick/gemini en rsync
deploy_gemini gemini://sdf.org/mcornick/ mcornick@sdf.org:/sdf/arpa/gm/m/mcornick/gopher en rsync
ssh mcornick@sdf.org mkgopher -p >/dev/null 2>&1

Loading…
Cancel
Save