Commit 76b13a6038
Unsigned
Layout: unified · split
build.sh +13 −13
| @@ -9,10 +9,10 @@ if [[ "$answer" =~ ^[Yy]$ ]]; then | ||
| 9 | 9 | # Check if the environment flag is set to PROD |
| 10 | 10 | if [[ "$ENV" == "prod" ]]; then |
| 11 | 11 | echo "Environment: Production" |
| 12 | ||
| 12 | ||
| 13 | 13 | # Check if publishing via LAN or remotely |
| 14 | 14 | printf "Publishing on remote or LAN? [r|l] " |
| 15 | ||
| 15 | ||
| 16 | 16 | # Update ubuntu_server variable based on answer |
| 17 | 17 | read method |
| 18 | 18 | if [[ "$method" =~ ^[Rr]$ ]]; then |
| @@ -23,30 +23,30 @@ if [[ "$answer" =~ ^[Yy]$ ]]; then | ||
| 23 | 23 | echo "Invalid input. Assuming LAN (ubuntu)" |
| 24 | 24 | ubuntu_server="ubuntu" |
| 25 | 25 | fi |
| 26 | ||
| 26 | ||
| 27 | 27 | # Remove previous build |
| 28 | 28 | rm -rf .build/* |
| 29 | ||
| 30 | # Run publishing script | |
| 31 | emacs --script publish.el &>/dev/null | |
| 32 | ||
| 29 | ||
| 33 | 30 | # Minify CSS |
| 34 | 31 | minify -o theme/static/styles.min.css theme/static/styles.css |
| 35 | ||
| 32 | ||
| 33 | # Run publishing script | |
| 34 | emacs --script publish.el &>/dev/null | |
| 35 | ||
| 36 | 36 | # Deploy changes |
| 37 | 37 | rsync -r --delete-before .build/* $ubuntu_server:/var/www/cmc.pub/ |
| 38 | 38 | else |
| 39 | 39 | echo "Environment: Development" |
| 40 | ||
| 40 | ||
| 41 | 41 | # Remove previous build |
| 42 | 42 | rm -rf .build/* |
| 43 | ||
| 44 | # Run publishing script | |
| 45 | emacs --script publish.el | |
| 46 | ||
| 43 | ||
| 47 | 44 | # Minify CSS |
| 48 | 45 | minify -o theme/static/styles.min.css theme/static/styles.css |
| 49 | 46 | |
| 47 | # Run publishing script | |
| 48 | emacs --script publish.el | |
| 49 | ||
| 50 | 50 | # Launch development web server |
| 51 | 51 | cd .build/ |
| 52 | 52 | python3 -m http.server |