Commit bcc50c5f12
Unsigned
Layout: unified · split
build.sh +26 −14
| @@ -4,20 +4,32 @@ printf "Did you update the 'Recent Blog Posts' section? [yn] " | ||
| 4 | 4 | read answer |
| 5 | 5 | |
| 6 | 6 | if [[ "$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 | ||
| 7 | 19 | 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 | |
| 21 | 33 | else |
| 22 | echo "Please update the 'Recent Blog Posts' section before publishing!" | |
| 34 | echo "Please update the 'Recent Blog Posts' section before publishing!" | |
| 23 | 35 | fi |