1. do not crash if git master is not available on startup, but local source exists (use that instead)
2. reduce verbosity of startup scripts
This commit is contained in:
parent
c5bd3c357e
commit
dff0116139
|
@ -1,11 +1,11 @@
|
||||||
#!/bin/sh -ex
|
#!/bin/sh -e
|
||||||
|
|
||||||
while ! pg_isready -h $DB_HOST -U $DB_USER; do
|
while ! pg_isready -h $DB_HOST -U $DB_USER; do
|
||||||
echo waiting until $DB_HOST is ready...
|
echo waiting until $DB_HOST is ready...
|
||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
|
|
||||||
if ! id app; then
|
if ! id app >/dev/null 2>&1; then
|
||||||
addgroup -g $OWNER_GID app
|
addgroup -g $OWNER_GID app
|
||||||
adduser -D -h /var/www/html -G app -u $OWNER_UID app
|
adduser -D -h /var/www/html -G app -u $OWNER_UID app
|
||||||
fi
|
fi
|
||||||
|
@ -21,21 +21,31 @@ export PGPASSWORD=$DB_PASS
|
||||||
|
|
||||||
PSQL="psql -q -h $DB_HOST -U $DB_USER $DB_NAME"
|
PSQL="psql -q -h $DB_HOST -U $DB_USER $DB_NAME"
|
||||||
|
|
||||||
if [ ! -d $DST_DIR ]; then
|
if [ ! -d $DST_DIR/.git ]; then
|
||||||
mkdir -p $DST_DIR
|
mkdir -p $DST_DIR
|
||||||
git clone $SRC_REPO $DST_DIR
|
echo cloning tt-rss source from $SRC_REPO to $DST_DIR...
|
||||||
|
git clone $SRC_REPO $DST_DIR || echo error: failed to clone master repository.
|
||||||
else
|
else
|
||||||
|
echo updating tt-rss source in $DST_DIR from $SRC_REPO...
|
||||||
cd $DST_DIR && \
|
cd $DST_DIR && \
|
||||||
git config core.filemode false && \
|
git config core.filemode false && \
|
||||||
git pull origin master
|
git pull origin master || echo error: unable to update master repository.
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -e $DST_DIR/index.php ]; then
|
||||||
|
echo "error: tt-rss index.php missing (git clone failed?), unable to continue."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d $DST_DIR/plugins.local/nginx_xaccel ]; then
|
if [ ! -d $DST_DIR/plugins.local/nginx_xaccel ]; then
|
||||||
git clone https://git.tt-rss.org/fox/ttrss-nginx-xaccel.git $DST_DIR/plugins.local/nginx_xaccel
|
echo cloning plugins.local/nginx_xaccel...
|
||||||
|
git clone https://git.tt-rss.org/fox/ttrss-nginx-xaccel.git \
|
||||||
|
$DST_DIR/plugins.local/nginx_xaccel || echo error: failed to clone plugin repository.
|
||||||
else
|
else
|
||||||
|
echo updating plugins.local/nginx_xaccel...
|
||||||
cd $DST_DIR/plugins.local/nginx_xaccel && \
|
cd $DST_DIR/plugins.local/nginx_xaccel && \
|
||||||
git config core.filemode false && \
|
git config core.filemode false && \
|
||||||
git pull origin master
|
git pull origin master || echo error: failed to update plugin repository.
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chown -R $OWNER_UID:$OWNER_GID $DST_DIR \
|
chown -R $OWNER_UID:$OWNER_GID $DST_DIR \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh -ex
|
#!/bin/sh -e
|
||||||
|
|
||||||
# wait for the app container to delete .app_is_ready and perform rsync, etc.
|
# wait for the app container to delete .app_is_ready and perform rsync, etc.
|
||||||
sleep 30
|
sleep 30
|
||||||
|
|
Loading…
Reference in New Issue