From 4877b846a8095289f19b6faacc5cff8bc3662147 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sat, 9 Jun 2018 14:55:51 +0200 Subject: [PATCH] Bugfixings - directory for worker.php changed to `bin/` - `composer install` isn't necessary for stable images - copy_sources should work for future *-rc branches too --- .bin/friendica | 19 +++++++++++-------- 2018.05/apache/bin/friendica | 19 +++++++++++-------- 2018.05/apache/cron.sh | 2 +- 2018.05/fpm-alpine/bin/friendica | 19 +++++++++++-------- 2018.05/fpm-alpine/cron.sh | 2 +- 2018.05/fpm/bin/friendica | 19 +++++++++++-------- 2018.05/fpm/cron.sh | 2 +- 2018.08-dev/apache/bin/friendica | 19 +++++++++++-------- 2018.08-dev/fpm-alpine/bin/friendica | 19 +++++++++++-------- 2018.08-dev/fpm/bin/friendica | 19 +++++++++++-------- docker-cron.sh | 2 +- update.sh | 9 --------- 12 files changed, 81 insertions(+), 69 deletions(-) diff --git a/.bin/friendica b/.bin/friendica index 3333d96..1a0e3fb 100644 --- a/.bin/friendica +++ b/.bin/friendica @@ -141,7 +141,7 @@ copy_sources() { fi if version_greater "$image_version" "$installed_version" || - echo "$image_version" | grep -Eq '^.*\-dev'; then + echo "$image_version" | grep -Eq '^.*\-dev|-rc'; then if [ "$(id -u)" -eq 0 ]; then rsync_options="-rlDog --chown=www-data:root" else @@ -149,11 +149,16 @@ copy_sources() { fi log 'Copying Friendica sources ('$image_version') from '\'$SOURCEDIR'/friendica'\'' to '\'$WORKDIR\' - rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' --exclude='vendor' $SOURCEDIR/friendica/ $WORKDIR/ + rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' $SOURCEDIR/friendica/ $WORKDIR/ if [ -f $WORKDIR/view/smarty3 ]; then chmod -R 777 $WORKDIR/view/smarty3 fi + + # the stable packages already have the whole vendor stuff in their images + if echo "$FRIENDICA_VERSION" | grep -Eq '^.*(\-dev|-rc)'; then + composer install + fi fi } @@ -165,10 +170,9 @@ install() { return fi - copy_sources - log 'Installing Friendica' - composer install + + copy_sources if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && @@ -187,11 +191,10 @@ update() { return fi - copy_sources - log 'Upgrading Friendica' - composer install + copy_sources + console dbstructure update } diff --git a/2018.05/apache/bin/friendica b/2018.05/apache/bin/friendica index 3333d96..1a0e3fb 100644 --- a/2018.05/apache/bin/friendica +++ b/2018.05/apache/bin/friendica @@ -141,7 +141,7 @@ copy_sources() { fi if version_greater "$image_version" "$installed_version" || - echo "$image_version" | grep -Eq '^.*\-dev'; then + echo "$image_version" | grep -Eq '^.*\-dev|-rc'; then if [ "$(id -u)" -eq 0 ]; then rsync_options="-rlDog --chown=www-data:root" else @@ -149,11 +149,16 @@ copy_sources() { fi log 'Copying Friendica sources ('$image_version') from '\'$SOURCEDIR'/friendica'\'' to '\'$WORKDIR\' - rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' --exclude='vendor' $SOURCEDIR/friendica/ $WORKDIR/ + rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' $SOURCEDIR/friendica/ $WORKDIR/ if [ -f $WORKDIR/view/smarty3 ]; then chmod -R 777 $WORKDIR/view/smarty3 fi + + # the stable packages already have the whole vendor stuff in their images + if echo "$FRIENDICA_VERSION" | grep -Eq '^.*(\-dev|-rc)'; then + composer install + fi fi } @@ -165,10 +170,9 @@ install() { return fi - copy_sources - log 'Installing Friendica' - composer install + + copy_sources if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && @@ -187,11 +191,10 @@ update() { return fi - copy_sources - log 'Upgrading Friendica' - composer install + copy_sources + console dbstructure update } diff --git a/2018.05/apache/cron.sh b/2018.05/apache/cron.sh index 432692c..8c29dee 100644 --- a/2018.05/apache/cron.sh +++ b/2018.05/apache/cron.sh @@ -6,6 +6,6 @@ while [ ! -f /var/www/html/.htconfig.php ]; do done while true; do - php -f /var/www/html/scripts/worker.php + php -f /var/www/html/bin/worker.php sleep 10m done \ No newline at end of file diff --git a/2018.05/fpm-alpine/bin/friendica b/2018.05/fpm-alpine/bin/friendica index 3333d96..1a0e3fb 100644 --- a/2018.05/fpm-alpine/bin/friendica +++ b/2018.05/fpm-alpine/bin/friendica @@ -141,7 +141,7 @@ copy_sources() { fi if version_greater "$image_version" "$installed_version" || - echo "$image_version" | grep -Eq '^.*\-dev'; then + echo "$image_version" | grep -Eq '^.*\-dev|-rc'; then if [ "$(id -u)" -eq 0 ]; then rsync_options="-rlDog --chown=www-data:root" else @@ -149,11 +149,16 @@ copy_sources() { fi log 'Copying Friendica sources ('$image_version') from '\'$SOURCEDIR'/friendica'\'' to '\'$WORKDIR\' - rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' --exclude='vendor' $SOURCEDIR/friendica/ $WORKDIR/ + rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' $SOURCEDIR/friendica/ $WORKDIR/ if [ -f $WORKDIR/view/smarty3 ]; then chmod -R 777 $WORKDIR/view/smarty3 fi + + # the stable packages already have the whole vendor stuff in their images + if echo "$FRIENDICA_VERSION" | grep -Eq '^.*(\-dev|-rc)'; then + composer install + fi fi } @@ -165,10 +170,9 @@ install() { return fi - copy_sources - log 'Installing Friendica' - composer install + + copy_sources if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && @@ -187,11 +191,10 @@ update() { return fi - copy_sources - log 'Upgrading Friendica' - composer install + copy_sources + console dbstructure update } diff --git a/2018.05/fpm-alpine/cron.sh b/2018.05/fpm-alpine/cron.sh index 432692c..8c29dee 100644 --- a/2018.05/fpm-alpine/cron.sh +++ b/2018.05/fpm-alpine/cron.sh @@ -6,6 +6,6 @@ while [ ! -f /var/www/html/.htconfig.php ]; do done while true; do - php -f /var/www/html/scripts/worker.php + php -f /var/www/html/bin/worker.php sleep 10m done \ No newline at end of file diff --git a/2018.05/fpm/bin/friendica b/2018.05/fpm/bin/friendica index 3333d96..1a0e3fb 100644 --- a/2018.05/fpm/bin/friendica +++ b/2018.05/fpm/bin/friendica @@ -141,7 +141,7 @@ copy_sources() { fi if version_greater "$image_version" "$installed_version" || - echo "$image_version" | grep -Eq '^.*\-dev'; then + echo "$image_version" | grep -Eq '^.*\-dev|-rc'; then if [ "$(id -u)" -eq 0 ]; then rsync_options="-rlDog --chown=www-data:root" else @@ -149,11 +149,16 @@ copy_sources() { fi log 'Copying Friendica sources ('$image_version') from '\'$SOURCEDIR'/friendica'\'' to '\'$WORKDIR\' - rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' --exclude='vendor' $SOURCEDIR/friendica/ $WORKDIR/ + rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' $SOURCEDIR/friendica/ $WORKDIR/ if [ -f $WORKDIR/view/smarty3 ]; then chmod -R 777 $WORKDIR/view/smarty3 fi + + # the stable packages already have the whole vendor stuff in their images + if echo "$FRIENDICA_VERSION" | grep -Eq '^.*(\-dev|-rc)'; then + composer install + fi fi } @@ -165,10 +170,9 @@ install() { return fi - copy_sources - log 'Installing Friendica' - composer install + + copy_sources if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && @@ -187,11 +191,10 @@ update() { return fi - copy_sources - log 'Upgrading Friendica' - composer install + copy_sources + console dbstructure update } diff --git a/2018.05/fpm/cron.sh b/2018.05/fpm/cron.sh index 432692c..8c29dee 100644 --- a/2018.05/fpm/cron.sh +++ b/2018.05/fpm/cron.sh @@ -6,6 +6,6 @@ while [ ! -f /var/www/html/.htconfig.php ]; do done while true; do - php -f /var/www/html/scripts/worker.php + php -f /var/www/html/bin/worker.php sleep 10m done \ No newline at end of file diff --git a/2018.08-dev/apache/bin/friendica b/2018.08-dev/apache/bin/friendica index 3333d96..1a0e3fb 100644 --- a/2018.08-dev/apache/bin/friendica +++ b/2018.08-dev/apache/bin/friendica @@ -141,7 +141,7 @@ copy_sources() { fi if version_greater "$image_version" "$installed_version" || - echo "$image_version" | grep -Eq '^.*\-dev'; then + echo "$image_version" | grep -Eq '^.*\-dev|-rc'; then if [ "$(id -u)" -eq 0 ]; then rsync_options="-rlDog --chown=www-data:root" else @@ -149,11 +149,16 @@ copy_sources() { fi log 'Copying Friendica sources ('$image_version') from '\'$SOURCEDIR'/friendica'\'' to '\'$WORKDIR\' - rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' --exclude='vendor' $SOURCEDIR/friendica/ $WORKDIR/ + rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' $SOURCEDIR/friendica/ $WORKDIR/ if [ -f $WORKDIR/view/smarty3 ]; then chmod -R 777 $WORKDIR/view/smarty3 fi + + # the stable packages already have the whole vendor stuff in their images + if echo "$FRIENDICA_VERSION" | grep -Eq '^.*(\-dev|-rc)'; then + composer install + fi fi } @@ -165,10 +170,9 @@ install() { return fi - copy_sources - log 'Installing Friendica' - composer install + + copy_sources if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && @@ -187,11 +191,10 @@ update() { return fi - copy_sources - log 'Upgrading Friendica' - composer install + copy_sources + console dbstructure update } diff --git a/2018.08-dev/fpm-alpine/bin/friendica b/2018.08-dev/fpm-alpine/bin/friendica index 3333d96..1a0e3fb 100644 --- a/2018.08-dev/fpm-alpine/bin/friendica +++ b/2018.08-dev/fpm-alpine/bin/friendica @@ -141,7 +141,7 @@ copy_sources() { fi if version_greater "$image_version" "$installed_version" || - echo "$image_version" | grep -Eq '^.*\-dev'; then + echo "$image_version" | grep -Eq '^.*\-dev|-rc'; then if [ "$(id -u)" -eq 0 ]; then rsync_options="-rlDog --chown=www-data:root" else @@ -149,11 +149,16 @@ copy_sources() { fi log 'Copying Friendica sources ('$image_version') from '\'$SOURCEDIR'/friendica'\'' to '\'$WORKDIR\' - rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' --exclude='vendor' $SOURCEDIR/friendica/ $WORKDIR/ + rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' $SOURCEDIR/friendica/ $WORKDIR/ if [ -f $WORKDIR/view/smarty3 ]; then chmod -R 777 $WORKDIR/view/smarty3 fi + + # the stable packages already have the whole vendor stuff in their images + if echo "$FRIENDICA_VERSION" | grep -Eq '^.*(\-dev|-rc)'; then + composer install + fi fi } @@ -165,10 +170,9 @@ install() { return fi - copy_sources - log 'Installing Friendica' - composer install + + copy_sources if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && @@ -187,11 +191,10 @@ update() { return fi - copy_sources - log 'Upgrading Friendica' - composer install + copy_sources + console dbstructure update } diff --git a/2018.08-dev/fpm/bin/friendica b/2018.08-dev/fpm/bin/friendica index 3333d96..1a0e3fb 100644 --- a/2018.08-dev/fpm/bin/friendica +++ b/2018.08-dev/fpm/bin/friendica @@ -141,7 +141,7 @@ copy_sources() { fi if version_greater "$image_version" "$installed_version" || - echo "$image_version" | grep -Eq '^.*\-dev'; then + echo "$image_version" | grep -Eq '^.*\-dev|-rc'; then if [ "$(id -u)" -eq 0 ]; then rsync_options="-rlDog --chown=www-data:root" else @@ -149,11 +149,16 @@ copy_sources() { fi log 'Copying Friendica sources ('$image_version') from '\'$SOURCEDIR'/friendica'\'' to '\'$WORKDIR\' - rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' --exclude='vendor' $SOURCEDIR/friendica/ $WORKDIR/ + rsync $rsync_options --delete --exclude='.git' --exclude='photo' --exclude='proxy' --exclude='.htconfig.php' --exclude='home.*' $SOURCEDIR/friendica/ $WORKDIR/ if [ -f $WORKDIR/view/smarty3 ]; then chmod -R 777 $WORKDIR/view/smarty3 fi + + # the stable packages already have the whole vendor stuff in their images + if echo "$FRIENDICA_VERSION" | grep -Eq '^.*(\-dev|-rc)'; then + composer install + fi fi } @@ -165,10 +170,9 @@ install() { return fi - copy_sources - log 'Installing Friendica' - composer install + + copy_sources if [ ! -f ${WORKDIR}/.htconfig.php ] && [ -f ${SOURCEDIR}/config/htconfig.php ] && @@ -187,11 +191,10 @@ update() { return fi - copy_sources - log 'Upgrading Friendica' - composer install + copy_sources + console dbstructure update } diff --git a/docker-cron.sh b/docker-cron.sh index 6711175..8c29dee 100644 --- a/docker-cron.sh +++ b/docker-cron.sh @@ -6,6 +6,6 @@ while [ ! -f /var/www/html/.htconfig.php ]; do done while true; do - php -f /var/www/html/%%DIR%%/worker.php + php -f /var/www/html/bin/worker.php sleep 10m done \ No newline at end of file diff --git a/update.sh b/update.sh index cab5d63..aee65be 100755 --- a/update.sh +++ b/update.sh @@ -32,11 +32,6 @@ declare -A install_extras=( ['develop']='' ) -declare -A bin_dir=( - ['stable']='scripts' - ['develop']='bin' -) - variants=( apache fpm @@ -91,10 +86,6 @@ function create_variant() { # Copy the bin directory cp -rT .bin "$dir/bin" - sed -ri -e ' - s/%%DIR%%/'"${bin_dir[$install_type]}"'/g; - ' "$dir/cron.sh" - travisEnvAmd64='\n - env: VERSION='"$1"' VARIANT='"$variant"' ARCH=amd64'"$travisEnvAmd64" for arch in i386 amd64; do travisEnv='\n - env: VERSION='"$1"' VARIANT='"$variant"' ARCH='"$arch$travisEnv"