ad scripts

This commit is contained in:
Rodolfo Berrios
2022-10-17 19:49:12 -03:00
parent 66d5a3786b
commit 2a09b77d18
5 changed files with 55 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
set -e
DOWNLOAD_DIR=${PWD}"/.temp"
WORKING_DIR=${PWD}"/chevereto"
PACKAGE=${VERSION}"-lite"
PACKAGE=${VERSION}
API_DOWNLOAD="https://chevereto.com/api/download/"
echo "* Downloading Chevereto"
rm -rf $DOWNLOAD_DIR $WORKING_DIR

10
scripts/demo-importing.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e
curl -S -o /var/www/html/importing/importing.tar.gz -L "https://codeload.github.com/chevereto/demo-importing/tar.gz/refs/heads/main"
tar -xf /var/www/html/importing/importing.tar.gz -C /var/www/html/importing/ &&
rm -rf /var/www/html/importing/importing.tar.gz &&
rsync -a /var/www/html/importing/demo-importing-main/ /var/www/html/importing/ &&
rm -rf /var/www/html/importing/demo-importing-main
chown www-data: /var/www/html/importing/ -R

17
scripts/observe.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
. $SCRIPT_DIR/sync.sh
inotifywait \
--event create \
--event delete \
--event modify \
--event move \
--format "%e %w%f" \
--exclude $EXCLUDE \
--monitor \
--recursive \
$SOURCE |
while read CHANGED; do
sync
done

19
scripts/sync.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
SOURCE=/var/www/chevereto/
TARGET=/var/www/html/
EXCLUDE="\.git|\.DS_Store|\.well-known|\.vscode|\/app\/vendor|\/app\/env\.php|\/app\/importer\/jobs"
rsync --mkpath -a "${SOURCE}"app/vendor/ "${TARGET}"app/vendor/
cp "${SOURCE}".gitignore "${TARGET}".gitignore
function sync() {
rsync -r -I -og \
--chown=www-data:www-data \
--info=progress2 \
--filter=':- .gitignore' \
--exclude '.git' \
--exclude '.well-known' \
--exclude '_assets/' \
--delete \
$SOURCE $TARGET
}
sync