diff options
| author | Christian Cleberg <[email protected]> | 2024-11-01 16:12:58 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2024-11-01 16:12:58 -0500 |
| commit | bcc50c5f12008b397430844f5d019b729d456008 (patch) | |
| tree | ef26066f77282caa08585d69aa5e63d3308c4c8a | |
| parent | 7438a402eabd60b4accbbd651a4f8649942742af (diff) | |
| download | cleberg.net-bcc50c5f12008b397430844f5d019b729d456008.tar.gz cleberg.net-bcc50c5f12008b397430844f5d019b729d456008.tar.bz2 cleberg.net-bcc50c5f12008b397430844f5d019b729d456008.zip | |
add deployment option to build script
| -rwxr-xr-x | build.sh | 40 |
1 files changed, 26 insertions, 14 deletions
@@ -4,20 +4,32 @@ printf "Did you update the 'Recent Blog Posts' section? [yn] " read answer if [[ "$answer" =~ ^[Yy]$ ]]; then + printf "Publishing on remote or LAN? [r|l] " + read method + + if [[ "$method" =~ ^[Rr]$ ]]; then + ubuntu_server="ubuntu-remote" + elif [[ "$method" =~ ^[Ll]$ ]]; then + ubuntu_server="ubuntu" + else + echo "Invalid input. Assuming LAN (ubuntu)" + ubuntu_server="ubuntu" + fi + if [[ "$ENV" == "prod" ]]; then - echo "Environment: Production" - rm -rf .build/* - emacs --script publish.el &>/dev/null - minify -o theme/static/styles.min.css theme/static/styles.css - rsync -r --delete-before .build/* ubuntu:/var/www/cleberg.net/ - else - echo "Environment: Development" - rm -rf .build/* - emacs --script publish.el - minify -o theme/static/styles.min.css theme/static/styles.css - cd .build/ - python3 -m http.server - fi + echo "Environment: Production" + rm -rf .build/* + emacs --script publish.el &>/dev/null + minify -o theme/static/styles.min.css theme/static/styles.css + rsync -r --delete-before .build/* $ubuntu_server:/var/www/cleberg.net/ + else + echo "Environment: Development" + rm -rf .build/* + emacs --script publish.el + minify -o theme/static/styles.min.css theme/static/styles.css + cd .build/ + python3 -m http.server + fi else - echo "Please update the 'Recent Blog Posts' section before publishing!" + echo "Please update the 'Recent Blog Posts' section before publishing!" fi |
