Commit bcc50c5f12

bcc50c5f12008b397430844f5d019b729d456008

parent: 7438a402ea

Unsigned

cmc <hello@cleberg.net> · 2024-11-01 21:12 UTC

add deployment option to build script

Layout: unified · split

build.sh +26 −14
@@ -4,20 +4,32 @@ printf "Did you update the 'Recent Blog Posts' section? [yn] "
44read answer
55
66if [[ "$answer" =~ ^[Yy]$ ]]; then
7 printf "Publishing on remote or LAN? [r|l] "
8 read method
9
10 if [[ "$method" =~ ^[Rr]$ ]]; then
11 ubuntu_server="ubuntu-remote"
12 elif [[ "$method" =~ ^[Ll]$ ]]; then
13 ubuntu_server="ubuntu"
14 else
15 echo "Invalid input. Assuming LAN (ubuntu)"
16 ubuntu_server="ubuntu"
17 fi
18
719 if [[ "$ENV" == "prod" ]]; then
8 echo "Environment: Production"
9 rm -rf .build/*
10 emacs --script publish.el &>/dev/null
11 minify -o theme/static/styles.min.css theme/static/styles.css
12 rsync -r --delete-before .build/* ubuntu:/var/www/cleberg.net/
13 else
14 echo "Environment: Development"
15 rm -rf .build/*
16 emacs --script publish.el
17 minify -o theme/static/styles.min.css theme/static/styles.css
18 cd .build/
19 python3 -m http.server
20 fi
20 echo "Environment: Production"
21 rm -rf .build/*
22 emacs --script publish.el &>/dev/null
23 minify -o theme/static/styles.min.css theme/static/styles.css
24 rsync -r --delete-before .build/* $ubuntu_server:/var/www/cleberg.net/
25 else
26 echo "Environment: Development"
27 rm -rf .build/*
28 emacs --script publish.el
29 minify -o theme/static/styles.min.css theme/static/styles.css
30 cd .build/
31 python3 -m http.server
32 fi
2133else
22 echo "Please update the 'Recent Blog Posts' section before publishing!"
34 echo "Please update the 'Recent Blog Posts' section before publishing!"
2335fi