Skip to content

Commit ec70d44

Browse files
committed
Run update.sh
Signed-off-by: Mike Cronce <mike@quadra-tec.net>
1 parent 01e6572 commit ec70d44

12 files changed

Lines changed: 126 additions & 66 deletions

File tree

32/apache/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ RUN { \
132132
chown -R www-data:root /var/www; \
133133
chmod -R g=u /var/www
134134

135-
VOLUME /var/www/html
135+
VOLUME /var/www/html/data
136+
VOLUME /var/www/html/config
137+
VOLUME /var/www/html/custom_apps
138+
VOLUME /var/www/html/themes
139+
VOLUME /var/www/tmp
136140

137141
RUN a2enmod headers rewrite remoteip ; \
138142
{ \
@@ -167,12 +171,17 @@ RUN set -ex; \
167171
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
168172
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
169173
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
174+
mkdir /usr/src/nextcloud-base; \
175+
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
176+
rm -Rvf /var/www/html; \
177+
mv -vf /usr/src/nextcloud /var/www/html; \
178+
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
170179
gpgconf --kill all; \
171-
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
172-
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
173-
mkdir -p /usr/src/nextcloud/data; \
174-
mkdir -p /usr/src/nextcloud/custom_apps; \
175-
chmod +x /usr/src/nextcloud/occ; \
180+
rm -rf "$GNUPGHOME" /var/www/html/updater; \
181+
mkdir -p /var/www/html/data; \
182+
mkdir -p /var/www/html/custom_apps; \
183+
mkdir -p /var/www/html/themes; \
184+
chmod +x /var/www/html/occ; \
176185
\
177186
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
178187
apt-get dist-clean

32/apache/entrypoint.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
174174
fi
175175

176176
installed_version="0.0.0.0"
177-
if [ -f /var/www/html/version.php ]; then
177+
if [ -f /var/www/html/config/version.php ]; then
178178
# shellcheck disable=SC2016
179-
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
179+
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
180180
fi
181181
# shellcheck disable=SC2016
182-
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
182+
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
183183

184184
if version_greater "$installed_version" "$image_version"; then
185185
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@@ -203,13 +203,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
203203
rsync_options="-rlD"
204204
fi
205205

206-
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
207206
for dir in config data custom_apps themes; do
208207
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
209208
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
210209
fi
211210
done
212-
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
213211

214212
# Install
215213
if [ "$installed_version" = "0.0.0.0" ]; then
@@ -304,6 +302,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
304302
run_path post-upgrade
305303
fi
306304

305+
cp -vf /var/www/html/version.php /var/www/html/config/
306+
chown -c $user:$group /var/www/html/config/version.php
307+
307308
echo "Initializing finished"
308309
fi
309310

32/fpm-alpine/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ RUN { \
125125
chown -R www-data:root /var/www; \
126126
chmod -R g=u /var/www
127127

128-
VOLUME /var/www/html
128+
VOLUME /var/www/html/data
129+
VOLUME /var/www/html/config
130+
VOLUME /var/www/html/custom_apps
131+
VOLUME /var/www/html/themes
132+
VOLUME /var/www/tmp
129133

130134

131135
ENV NEXTCLOUD_VERSION 32.0.7
@@ -143,12 +147,17 @@ RUN set -ex; \
143147
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
144148
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
145149
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
150+
mkdir /usr/src/nextcloud-base; \
151+
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
152+
rm -Rvf /var/www/html; \
153+
mv -vf /usr/src/nextcloud /var/www/html; \
154+
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
146155
gpgconf --kill all; \
147-
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
148-
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
149-
mkdir -p /usr/src/nextcloud/data; \
150-
mkdir -p /usr/src/nextcloud/custom_apps; \
151-
chmod +x /usr/src/nextcloud/occ; \
156+
rm -rf "$GNUPGHOME" /var/www/html/updater; \
157+
mkdir -p /var/www/html/data; \
158+
mkdir -p /var/www/html/custom_apps; \
159+
mkdir -p /var/www/html/themes; \
160+
chmod +x /var/www/html/occ; \
152161
apk del --no-network .fetch-deps
153162

154163
COPY *.sh upgrade.exclude /

32/fpm-alpine/entrypoint.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
174174
fi
175175

176176
installed_version="0.0.0.0"
177-
if [ -f /var/www/html/version.php ]; then
177+
if [ -f /var/www/html/config/version.php ]; then
178178
# shellcheck disable=SC2016
179-
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
179+
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
180180
fi
181181
# shellcheck disable=SC2016
182-
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
182+
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
183183

184184
if version_greater "$installed_version" "$image_version"; then
185185
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@@ -203,13 +203,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
203203
rsync_options="-rlD"
204204
fi
205205

206-
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
207206
for dir in config data custom_apps themes; do
208207
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
209208
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
210209
fi
211210
done
212-
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
213211

214212
# Install
215213
if [ "$installed_version" = "0.0.0.0" ]; then
@@ -304,6 +302,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
304302
run_path post-upgrade
305303
fi
306304

305+
cp -vf /var/www/html/version.php /var/www/html/config/
306+
chown -c $user:$group /var/www/html/config/version.php
307+
307308
echo "Initializing finished"
308309
fi
309310

32/fpm/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ RUN { \
132132
chown -R www-data:root /var/www; \
133133
chmod -R g=u /var/www
134134

135-
VOLUME /var/www/html
135+
VOLUME /var/www/html/data
136+
VOLUME /var/www/html/config
137+
VOLUME /var/www/html/custom_apps
138+
VOLUME /var/www/html/themes
139+
VOLUME /var/www/tmp
136140

137141

138142
ENV NEXTCLOUD_VERSION 32.0.7
@@ -152,12 +156,17 @@ RUN set -ex; \
152156
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
153157
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
154158
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
159+
mkdir /usr/src/nextcloud-base; \
160+
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
161+
rm -Rvf /var/www/html; \
162+
mv -vf /usr/src/nextcloud /var/www/html; \
163+
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
155164
gpgconf --kill all; \
156-
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
157-
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
158-
mkdir -p /usr/src/nextcloud/data; \
159-
mkdir -p /usr/src/nextcloud/custom_apps; \
160-
chmod +x /usr/src/nextcloud/occ; \
165+
rm -rf "$GNUPGHOME" /var/www/html/updater; \
166+
mkdir -p /var/www/html/data; \
167+
mkdir -p /var/www/html/custom_apps; \
168+
mkdir -p /var/www/html/themes; \
169+
chmod +x /var/www/html/occ; \
161170
\
162171
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
163172
apt-get dist-clean

32/fpm/entrypoint.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
174174
fi
175175

176176
installed_version="0.0.0.0"
177-
if [ -f /var/www/html/version.php ]; then
177+
if [ -f /var/www/html/config/version.php ]; then
178178
# shellcheck disable=SC2016
179-
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
179+
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
180180
fi
181181
# shellcheck disable=SC2016
182-
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
182+
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
183183

184184
if version_greater "$installed_version" "$image_version"; then
185185
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@@ -203,13 +203,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
203203
rsync_options="-rlD"
204204
fi
205205

206-
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
207206
for dir in config data custom_apps themes; do
208207
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
209208
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
210209
fi
211210
done
212-
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
213211

214212
# Install
215213
if [ "$installed_version" = "0.0.0.0" ]; then
@@ -304,6 +302,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
304302
run_path post-upgrade
305303
fi
306304

305+
cp -vf /var/www/html/version.php /var/www/html/config/
306+
chown -c $user:$group /var/www/html/config/version.php
307+
307308
echo "Initializing finished"
308309
fi
309310

33/apache/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ RUN { \
132132
chown -R www-data:root /var/www; \
133133
chmod -R g=u /var/www
134134

135-
VOLUME /var/www/html
135+
VOLUME /var/www/html/data
136+
VOLUME /var/www/html/config
137+
VOLUME /var/www/html/custom_apps
138+
VOLUME /var/www/html/themes
139+
VOLUME /var/www/tmp
136140

137141
RUN a2enmod headers rewrite remoteip ; \
138142
{ \
@@ -167,12 +171,17 @@ RUN set -ex; \
167171
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
168172
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
169173
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
174+
mkdir /usr/src/nextcloud-base; \
175+
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
176+
rm -Rvf /var/www/html; \
177+
mv -vf /usr/src/nextcloud /var/www/html; \
178+
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
170179
gpgconf --kill all; \
171-
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
172-
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
173-
mkdir -p /usr/src/nextcloud/data; \
174-
mkdir -p /usr/src/nextcloud/custom_apps; \
175-
chmod +x /usr/src/nextcloud/occ; \
180+
rm -rf "$GNUPGHOME" /var/www/html/updater; \
181+
mkdir -p /var/www/html/data; \
182+
mkdir -p /var/www/html/custom_apps; \
183+
mkdir -p /var/www/html/themes; \
184+
chmod +x /var/www/html/occ; \
176185
\
177186
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps; \
178187
apt-get dist-clean

33/apache/entrypoint.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
174174
fi
175175

176176
installed_version="0.0.0.0"
177-
if [ -f /var/www/html/version.php ]; then
177+
if [ -f /var/www/html/config/version.php ]; then
178178
# shellcheck disable=SC2016
179-
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
179+
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
180180
fi
181181
# shellcheck disable=SC2016
182-
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
182+
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
183183

184184
if version_greater "$installed_version" "$image_version"; then
185185
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@@ -203,13 +203,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
203203
rsync_options="-rlD"
204204
fi
205205

206-
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
207206
for dir in config data custom_apps themes; do
208207
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
209208
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
210209
fi
211210
done
212-
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
213211

214212
# Install
215213
if [ "$installed_version" = "0.0.0.0" ]; then
@@ -304,6 +302,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
304302
run_path post-upgrade
305303
fi
306304

305+
cp -vf /var/www/html/version.php /var/www/html/config/
306+
chown -c $user:$group /var/www/html/config/version.php
307+
307308
echo "Initializing finished"
308309
fi
309310

33/fpm-alpine/Dockerfile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ RUN { \
125125
chown -R www-data:root /var/www; \
126126
chmod -R g=u /var/www
127127

128-
VOLUME /var/www/html
128+
VOLUME /var/www/html/data
129+
VOLUME /var/www/html/config
130+
VOLUME /var/www/html/custom_apps
131+
VOLUME /var/www/html/themes
132+
VOLUME /var/www/tmp
129133

130134

131135
ENV NEXTCLOUD_VERSION 33.0.1
@@ -143,12 +147,17 @@ RUN set -ex; \
143147
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \
144148
gpg --batch --verify nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
145149
tar -xjf nextcloud.tar.bz2 -C /usr/src/; \
150+
mkdir /usr/src/nextcloud-base; \
151+
mv -vf /usr/src/nextcloud/config /usr/src/nextcloud/themes /usr/src/nextcloud-base/; \
152+
rm -Rvf /var/www/html; \
153+
mv -vf /usr/src/nextcloud /var/www/html; \
154+
mv -vf /usr/src/nextcloud-base /usr/src/nextcloud; \
146155
gpgconf --kill all; \
147-
rm nextcloud.tar.bz2.asc nextcloud.tar.bz2; \
148-
rm -rf "$GNUPGHOME" /usr/src/nextcloud/updater; \
149-
mkdir -p /usr/src/nextcloud/data; \
150-
mkdir -p /usr/src/nextcloud/custom_apps; \
151-
chmod +x /usr/src/nextcloud/occ; \
156+
rm -rf "$GNUPGHOME" /var/www/html/updater; \
157+
mkdir -p /var/www/html/data; \
158+
mkdir -p /var/www/html/custom_apps; \
159+
mkdir -p /var/www/html/themes; \
160+
chmod +x /var/www/html/occ; \
152161
apk del --no-network .fetch-deps
153162

154163
COPY *.sh upgrade.exclude /

33/fpm-alpine/entrypoint.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
174174
fi
175175

176176
installed_version="0.0.0.0"
177-
if [ -f /var/www/html/version.php ]; then
177+
if [ -f /var/www/html/config/version.php ]; then
178178
# shellcheck disable=SC2016
179-
installed_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
179+
installed_version="$(php -r 'require "/var/www/html/config/version.php"; echo implode(".", $OC_Version);')"
180180
fi
181181
# shellcheck disable=SC2016
182-
image_version="$(php -r 'require "/usr/src/nextcloud/version.php"; echo implode(".", $OC_Version);')"
182+
image_version="$(php -r 'require "/var/www/html/version.php"; echo implode(".", $OC_Version);')"
183183

184184
if version_greater "$installed_version" "$image_version"; then
185185
echo "Can't start Nextcloud because the version of the data ($installed_version) is higher than the docker image version ($image_version) and downgrading is not supported. Are you sure you have pulled the newest image version?"
@@ -203,13 +203,11 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
203203
rsync_options="-rlD"
204204
fi
205205

206-
rsync $rsync_options --delete --exclude-from=/upgrade.exclude /usr/src/nextcloud/ /var/www/html/
207206
for dir in config data custom_apps themes; do
208207
if [ ! -d "/var/www/html/$dir" ] || directory_empty "/var/www/html/$dir"; then
209208
rsync $rsync_options --include "/$dir/" --exclude '/*' /usr/src/nextcloud/ /var/www/html/
210209
fi
211210
done
212-
rsync $rsync_options --include '/version.php' --exclude '/*' /usr/src/nextcloud/ /var/www/html/
213211

214212
# Install
215213
if [ "$installed_version" = "0.0.0.0" ]; then
@@ -304,6 +302,9 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
304302
run_path post-upgrade
305303
fi
306304

305+
cp -vf /var/www/html/version.php /var/www/html/config/
306+
chown -c $user:$group /var/www/html/config/version.php
307+
307308
echo "Initializing finished"
308309
fi
309310

0 commit comments

Comments
 (0)