Skip to content

Commit 040d868

Browse files
author
GitHub Workflow
committed
Runs update.sh
1 parent d325146 commit 040d868

19 files changed

Lines changed: 447 additions & 24 deletions

25/apache/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ RUN { \
111111
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
112112
\
113113
mkdir /var/www/data; \
114+
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
115+
/docker-entrypoint-hooks.d/post-installation \
116+
/docker-entrypoint-hooks.d/pre-upgrade \
117+
/docker-entrypoint-hooks.d/post-upgrade \
118+
/docker-entrypoint-hooks.d/before-starting; \
114119
chown -R www-data:root /var/www; \
115120
chmod -R g=u /var/www
116121

@@ -125,7 +130,7 @@ RUN a2enmod headers rewrite remoteip ;\
125130
} > /etc/apache2/conf-available/remoteip.conf;\
126131
a2enconf remoteip
127132

128-
ENV NEXTCLOUD_VERSION 25.0.7
133+
ENV NEXTCLOUD_VERSION 25.0.8
129134

130135
RUN set -ex; \
131136
fetchDeps=" \
@@ -135,8 +140,8 @@ RUN set -ex; \
135140
apt-get update; \
136141
apt-get install -y --no-install-recommends $fetchDeps; \
137142
\
138-
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2"; \
139-
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2.asc"; \
143+
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2"; \
144+
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2.asc"; \
140145
export GNUPGHOME="$(mktemp -d)"; \
141146
# gpg key from https://nextcloud.com/nextcloud.asc
142147
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \

25/apache/entrypoint.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,39 @@ run_as() {
1919
fi
2020
}
2121

22+
# Execute all executable files in a given directory in alphanumeric order
23+
run_path() {
24+
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
25+
local return_code=0
26+
27+
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
28+
29+
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
30+
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
31+
return 0
32+
fi
33+
34+
(
35+
for script_file_path in "${hook_folder_path}/"*.sh; do
36+
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
37+
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
38+
continue
39+
fi
40+
41+
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
42+
43+
run_as "${script_file_path}" || return_code="$?"
44+
45+
if [ "${return_code}" -ne "0" ]; then
46+
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
47+
exit 1
48+
fi
49+
50+
echo "==> Finished the script: \"${script_file_path}\""
51+
done
52+
)
53+
}
54+
2255
# usage: file_env VAR [DEFAULT]
2356
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
2457
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
@@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
182215
fi
183216

184217
if [ "$install" = true ]; then
218+
run_path pre-installation
219+
185220
echo "Starting nextcloud installation"
186221
max_retries=10
187222
try=0
@@ -204,19 +239,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
204239
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
205240
done
206241
fi
242+
243+
run_path post-installation
207244
else
208245
echo "Please run the web-based installer on first connect!"
209246
fi
210247
fi
211248
# Upgrade
212249
else
250+
run_path pre-upgrade
251+
213252
run_as 'php /var/www/html/occ upgrade'
214253

215254
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
216255
echo "The following apps have been disabled:"
217256
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
218257
rm -f /tmp/list_before /tmp/list_after
219258

259+
run_path post-upgrade
220260
fi
221261

222262
echo "Initializing finished"
@@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
227267
run_as 'php /var/www/html/occ maintenance:update:htaccess'
228268
fi
229269
) 9> /var/www/html/nextcloud-init-sync.lock
270+
271+
run_path before-starting
230272
fi
231273

232274
exec "$@"

25/fpm-alpine/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,27 @@ RUN { \
9999
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
100100
\
101101
mkdir /var/www/data; \
102+
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
103+
/docker-entrypoint-hooks.d/post-installation \
104+
/docker-entrypoint-hooks.d/pre-upgrade \
105+
/docker-entrypoint-hooks.d/post-upgrade \
106+
/docker-entrypoint-hooks.d/before-starting; \
102107
chown -R www-data:root /var/www; \
103108
chmod -R g=u /var/www
104109

105110
VOLUME /var/www/html
106111

107112

108-
ENV NEXTCLOUD_VERSION 25.0.7
113+
ENV NEXTCLOUD_VERSION 25.0.8
109114

110115
RUN set -ex; \
111116
apk add --no-cache --virtual .fetch-deps \
112117
bzip2 \
113118
gnupg \
114119
; \
115120
\
116-
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2"; \
117-
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2.asc"; \
121+
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2"; \
122+
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2.asc"; \
118123
export GNUPGHOME="$(mktemp -d)"; \
119124
# gpg key from https://nextcloud.com/nextcloud.asc
120125
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \

25/fpm-alpine/entrypoint.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,39 @@ run_as() {
1919
fi
2020
}
2121

22+
# Execute all executable files in a given directory in alphanumeric order
23+
run_path() {
24+
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
25+
local return_code=0
26+
27+
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
28+
29+
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
30+
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
31+
return 0
32+
fi
33+
34+
(
35+
for script_file_path in "${hook_folder_path}/"*.sh; do
36+
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
37+
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
38+
continue
39+
fi
40+
41+
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
42+
43+
run_as "${script_file_path}" || return_code="$?"
44+
45+
if [ "${return_code}" -ne "0" ]; then
46+
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
47+
exit 1
48+
fi
49+
50+
echo "==> Finished the script: \"${script_file_path}\""
51+
done
52+
)
53+
}
54+
2255
# usage: file_env VAR [DEFAULT]
2356
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
2457
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
@@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
182215
fi
183216

184217
if [ "$install" = true ]; then
218+
run_path pre-installation
219+
185220
echo "Starting nextcloud installation"
186221
max_retries=10
187222
try=0
@@ -204,19 +239,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
204239
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
205240
done
206241
fi
242+
243+
run_path post-installation
207244
else
208245
echo "Please run the web-based installer on first connect!"
209246
fi
210247
fi
211248
# Upgrade
212249
else
250+
run_path pre-upgrade
251+
213252
run_as 'php /var/www/html/occ upgrade'
214253

215254
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
216255
echo "The following apps have been disabled:"
217256
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
218257
rm -f /tmp/list_before /tmp/list_after
219258

259+
run_path post-upgrade
220260
fi
221261

222262
echo "Initializing finished"
@@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
227267
run_as 'php /var/www/html/occ maintenance:update:htaccess'
228268
fi
229269
) 9> /var/www/html/nextcloud-init-sync.lock
270+
271+
run_path before-starting
230272
fi
231273

232274
exec "$@"

25/fpm/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,18 @@ RUN { \
111111
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
112112
\
113113
mkdir /var/www/data; \
114+
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
115+
/docker-entrypoint-hooks.d/post-installation \
116+
/docker-entrypoint-hooks.d/pre-upgrade \
117+
/docker-entrypoint-hooks.d/post-upgrade \
118+
/docker-entrypoint-hooks.d/before-starting; \
114119
chown -R www-data:root /var/www; \
115120
chmod -R g=u /var/www
116121

117122
VOLUME /var/www/html
118123

119124

120-
ENV NEXTCLOUD_VERSION 25.0.7
125+
ENV NEXTCLOUD_VERSION 25.0.8
121126

122127
RUN set -ex; \
123128
fetchDeps=" \
@@ -127,8 +132,8 @@ RUN set -ex; \
127132
apt-get update; \
128133
apt-get install -y --no-install-recommends $fetchDeps; \
129134
\
130-
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2"; \
131-
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.7.tar.bz2.asc"; \
135+
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2"; \
136+
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-25.0.8.tar.bz2.asc"; \
132137
export GNUPGHOME="$(mktemp -d)"; \
133138
# gpg key from https://nextcloud.com/nextcloud.asc
134139
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \

25/fpm/entrypoint.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,39 @@ run_as() {
1919
fi
2020
}
2121

22+
# Execute all executable files in a given directory in alphanumeric order
23+
run_path() {
24+
local hook_folder_path="/docker-entrypoint-hooks.d/$1"
25+
local return_code=0
26+
27+
echo "=> Searching for scripts (*.sh) to run, located in the folder: ${hook_folder_path}"
28+
29+
if [ -z "$(ls -A "${hook_folder_path}")" ]; then
30+
echo "==> but the hook folder \"$(basename "${hook_folder_path}")\" is empty, so nothing to do"
31+
return 0
32+
fi
33+
34+
(
35+
for script_file_path in "${hook_folder_path}/"*.sh; do
36+
if ! [ -x "${script_file_path}" ] && [ -f "${script_file_path}" ]; then
37+
echo "==> The script \"${script_file_path}\" in the folder \"${hook_folder_path}\" was skipping, because it didn't have the executable flag"
38+
continue
39+
fi
40+
41+
echo "==> Running the script (cwd: $(pwd)): \"${script_file_path}\""
42+
43+
run_as "${script_file_path}" || return_code="$?"
44+
45+
if [ "${return_code}" -ne "0" ]; then
46+
echo "==> Failed at executing \"${script_file_path}\". Exit code: ${return_code}"
47+
exit 1
48+
fi
49+
50+
echo "==> Finished the script: \"${script_file_path}\""
51+
done
52+
)
53+
}
54+
2255
# usage: file_env VAR [DEFAULT]
2356
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
2457
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
@@ -182,6 +215,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
182215
fi
183216

184217
if [ "$install" = true ]; then
218+
run_path pre-installation
219+
185220
echo "Starting nextcloud installation"
186221
max_retries=10
187222
try=0
@@ -204,19 +239,24 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
204239
NC_TRUSTED_DOMAIN_IDX=$((NC_TRUSTED_DOMAIN_IDX+1))
205240
done
206241
fi
242+
243+
run_path post-installation
207244
else
208245
echo "Please run the web-based installer on first connect!"
209246
fi
210247
fi
211248
# Upgrade
212249
else
250+
run_path pre-upgrade
251+
213252
run_as 'php /var/www/html/occ upgrade'
214253

215254
run_as 'php /var/www/html/occ app:list' | sed -n "/Enabled:/,/Disabled:/p" > /tmp/list_after
216255
echo "The following apps have been disabled:"
217256
diff /tmp/list_before /tmp/list_after | grep '<' | cut -d- -f2 | cut -d: -f1
218257
rm -f /tmp/list_before /tmp/list_after
219258

259+
run_path post-upgrade
220260
fi
221261

222262
echo "Initializing finished"
@@ -227,6 +267,8 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
227267
run_as 'php /var/www/html/occ maintenance:update:htaccess'
228268
fi
229269
) 9> /var/www/html/nextcloud-init-sync.lock
270+
271+
run_path before-starting
230272
fi
231273

232274
exec "$@"

26/apache/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ RUN { \
112112
} > "${PHP_INI_DIR}/conf.d/nextcloud.ini"; \
113113
\
114114
mkdir /var/www/data; \
115+
mkdir -p /docker-entrypoint-hooks.d/pre-installation \
116+
/docker-entrypoint-hooks.d/post-installation \
117+
/docker-entrypoint-hooks.d/pre-upgrade \
118+
/docker-entrypoint-hooks.d/post-upgrade \
119+
/docker-entrypoint-hooks.d/before-starting; \
115120
chown -R www-data:root /var/www; \
116121
chmod -R g=u /var/www
117122

@@ -126,7 +131,7 @@ RUN a2enmod headers rewrite remoteip ;\
126131
} > /etc/apache2/conf-available/remoteip.conf;\
127132
a2enconf remoteip
128133

129-
ENV NEXTCLOUD_VERSION 26.0.2
134+
ENV NEXTCLOUD_VERSION 26.0.3
130135

131136
RUN set -ex; \
132137
fetchDeps=" \
@@ -136,8 +141,8 @@ RUN set -ex; \
136141
apt-get update; \
137142
apt-get install -y --no-install-recommends $fetchDeps; \
138143
\
139-
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-26.0.2.tar.bz2"; \
140-
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-26.0.2.tar.bz2.asc"; \
144+
curl -fsSL -o nextcloud.tar.bz2 "https://download.nextcloud.com/server/releases/nextcloud-26.0.3.tar.bz2"; \
145+
curl -fsSL -o nextcloud.tar.bz2.asc "https://download.nextcloud.com/server/releases/nextcloud-26.0.3.tar.bz2.asc"; \
141146
export GNUPGHOME="$(mktemp -d)"; \
142147
# gpg key from https://nextcloud.com/nextcloud.asc
143148
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 28806A878AE423A28372792ED75899B9A724937A; \

0 commit comments

Comments
 (0)