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