mirror of
https://github.com/chevereto/docker.git
synced 2026-05-06 14:36:40 +02:00
ad scripts
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -108,6 +108,14 @@ RUN set -eux; \
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
COPY scripts /var/scripts
|
||||
|
||||
RUN chmod +x \
|
||||
/var/scripts/demo-importing.sh \
|
||||
/var/scripts/logo.sh \
|
||||
/var/scripts/observe.sh \
|
||||
/var/scripts/sync.sh
|
||||
|
||||
RUN mkdir -p _assets images \
|
||||
importing/no-parse \
|
||||
importing/parse-albums \
|
||||
@@ -115,8 +123,4 @@ RUN mkdir -p _assets images \
|
||||
|
||||
COPY --chown=www-data chevereto/ .
|
||||
|
||||
RUN composer install \
|
||||
--working-dir=app \
|
||||
--no-progress
|
||||
|
||||
RUN chown www-data: . -R && ls -la
|
||||
|
||||
@@ -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
10
scripts/demo-importing.sh
Executable 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
17
scripts/observe.sh
Executable 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
19
scripts/sync.sh
Executable 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
|
||||
Reference in New Issue
Block a user