diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-06-08 10:05:30 +0100 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-06-08 10:05:30 +0100 |
commit | 46087a2503032443d7f0613e5aeb2a5195c27850 (patch) | |
tree | 910ebd4bdc62360ed53881671a471d5ef2e2ca44 /bin | |
parent | bff0778cb9751a0581ab0eb2ca97cbdca8bcca03 (diff) | |
download | bookup-46087a2503032443d7f0613e5aeb2a5195c27850.tar.gz bookup-46087a2503032443d7f0613e5aeb2a5195c27850.tar.bz2 |
Fix: misc improvements
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/archive | 11 | ||||
-rwxr-xr-x | bin/assemble | 19 | ||||
-rwxr-xr-x | bin/provision-host | 8 |
3 files changed, 20 insertions, 18 deletions
diff --git a/bin/archive b/bin/archive index 584ea13..8949268 100755 --- a/bin/archive +++ b/bin/archive @@ -9,14 +9,15 @@ DIRNAME="`dirname $0`" BASEDIR="$DIRNAME/.." #ARCHIVE="$BASEDIR/archive" ARCHIVE="archive" +ASSETS="build" REVISION="`git describe --tags 2> /dev/null || git log -1 --format=oneline | cut -d ' ' -f 1`" # Determine the revision file -if [ -e "public/revision" ]; then - #REVFILE="$BASEDIR/public/revision" - REVFILE="public/revision" +if [ -e "$ASSETS/revision" ]; then + #REVFILE="$BASEDIR/$ASSETS/revision" + REVFILE="$ASSETS/revision" else - REVFILE="public/book/revision" + REVFILE="$ASSETS/book/revision" fi # Make sure the archive folder exist @@ -41,7 +42,7 @@ if git tag | grep -q "^${OLD_REVISION}"; then # Check if archive does not exists if [ ! -d "$ARCHIVE/$OLD_REVISION" ]; then echo "# $BASENAME: archiving $OLD_REVISION..." - cp -alf compiled $ARCHIVE/$OLD_REVISION + cp -alf $ASSETS $ARCHIVE/$OLD_REVISION else echo "# $BASENAME: revision $OLD_REVISION already archived" fi diff --git a/bin/assemble b/bin/assemble index cd0836c..3b5b287 100755 --- a/bin/assemble +++ b/bin/assemble @@ -8,26 +8,27 @@ BASENAME="`basename $0 | sed -e 's/\(.\)/\U\1/'`" DIRNAME="`dirname $0`" BASEDIR="$DIRNAME/.." SITE="site" +BOOK="book" NOTEBOOK="notebook" -PUBLIC="public" +BUILD="build" -# Cleanup the previous public folder -rm -rf $PUBLIC +# Cleanup the previous build folder +rm -rf $BUILD # Check if there's a site folder if [ -e "$SITE" ]; then - cp -a $SITE public + cp -a $SITE $BUILD - if [ -e "compiled" ]; then - mv compiled public/book + if [ -e "$BOOK" ]; then + mv $BOOK $BUILD/book fi else - if [ -e "compiled" ]; then - mv compiled public + if [ -e "$BOOK" ]; then + mv $BOOK $BUILD fi fi # Check if there's a notebook if [ -e "$NOTEBOOK" ]; then - mv $NOTEBOOK public/notes + mv $NOTEBOOK $BUILD/notes fi diff --git a/bin/provision-host b/bin/provision-host index 13b8a78..81cf602 100755 --- a/bin/provision-host +++ b/bin/provision-host @@ -44,9 +44,9 @@ cat <<-EOF | $SUDO tee /etc/apache2/sites-available/onion.conf > /dev/null <VirtualHost 127.0.0.1:80> ServerName localhost ServerAlias *.onion - DocumentRoot "/srv/shared/public" + DocumentRoot "/srv/shared/build" - <Directory /srv/shared/public> + <Directory /srv/shared/build> #AuthType Basic #AuthName "Protected" #AuthUserFile /srv/shared/.htpasswd @@ -62,9 +62,9 @@ EOF cat <<-EOF | $SUDO tee /etc/apache2/sites-available/local.conf > /dev/null <VirtualHost *:80> ServerName ${PROJECT}.local - DocumentRoot "/srv/shared/public" + DocumentRoot "/srv/shared/build" - <Directory /srv/shared/public> + <Directory /srv/shared/build> #AuthType Basic #AuthName "Protected" #AuthUserFile /srv/shared/.htpasswd |