@@ -206,6 +206,24 @@ beach_run_custom_startup() {
206206 " ${BEACH_APPLICATION_PATH} /beach-startup.sh" 2>&1 | (sed ' s/^/Beach: (flow) /' | output)
207207}
208208
209+ beach_run_specified_hook () {
210+ if [ -n " $1 " ]; then
211+ if is_boolean_yes " $BEACH_APPLICATION_CUSTOM_STARTUP_SCRIPTS_ENABLE " ; then
212+ if [ ! -f " ${BEACH_APPLICATION_PATH} /$1 .sh" ]; then
213+ info " Beach: No $1 .sh found, skipping hook"
214+ return
215+ fi
216+ info " Beach: Running '$1 ' hook ($1 .sh) ..."
217+ chmod +x " ${BEACH_APPLICATION_PATH} /$1 .sh"
218+ " ${BEACH_APPLICATION_PATH} /$1 .sh" 2>&1 | (sed ' s/^/Beach: (flow) /' | output)
219+ else
220+ info " Beach: Skipping '$1 ' hook because custom startup scripts are disabled"
221+ fi
222+ else
223+ warn " No hook name given to run hook function, this should not happen"
224+ fi
225+ }
226+
209227# ---------------------------------------------------------------------------------------
210228# beach_run_sitemap_crawler() - Invoke a crawler which warms up caches for all urls of a sitemap
211229#
@@ -315,6 +333,8 @@ beach_initialize() {
315333 beach_setup_user_profile
316334 beach_setup_igbinary
317335 beach_setup_addon_blackfire
336+
337+ beach_run_specified_hook " beach-hook-initialize"
318338}
319339
320340# ---------------------------------------------------------------------------------------
@@ -344,6 +364,7 @@ beach_prepare_flow() {
344364 else
345365 info " Beach: Skipping custom startup scripts"
346366 fi
367+ beach_run_specified_hook " beach-hook-warmup"
347368
348369 beach_enable_user_services
349370}
@@ -364,7 +385,12 @@ beach_finalize_flow() {
364385 info " Beach: Running sitemap crawler ..."
365386 beach_run_sitemap_crawler
366387 fi
388+ }
367389
390+ beach_startup_complete () {
391+ beach_run_specified_hook " beach-hook-ready"
368392 debug " Beach: Writing .warmupdone flag"
369393 touch /application/.warmupdone
394+ info " .warmupdone written, this pod will now become ready"
395+ beach_run_specified_hook " beach-hook-live"
370396}
0 commit comments