From 4bcff3a805fbe348fa52cf6f0f308f55cfa31ec5 Mon Sep 17 00:00:00 2001 From: mosonyi Date: Mon, 6 Jun 2022 12:55:01 +0200 Subject: [PATCH] Add possibility to keep pub/static folder (#252) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add possibility to keep pub/static folder Signed-off-by: Zoltan Mosonyi * Keep setup:upgrade but use --keep-generated flag Signed-off-by: Zoltan Mosonyi * 2.4.4-debian-10-r20 release Signed-off-by: Zoltan Mosonyi * 2.4.4-debian-10-r21 release Signed-off-by: Zoltan Mosonyi * 2.4.4-debian-10-r22 release Signed-off-by: Zoltan Mosonyi * 2.4.4-debian-10-r23 release Signed-off-by: Zoltan Mosonyi Co-authored-by: Bitnami Bot Co-authored-by: Carlos Rodríguez Hernández --- .../2/debian-10/rootfs/opt/bitnami/scripts/libmagento.sh | 8 ++++++-- .../2/debian-10/rootfs/opt/bitnami/scripts/magento-env.sh | 2 ++ bitnami/magento/README.md | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bitnami/magento/2/debian-10/rootfs/opt/bitnami/scripts/libmagento.sh b/bitnami/magento/2/debian-10/rootfs/opt/bitnami/scripts/libmagento.sh index 4d2ef7bd90d9..1b81a812f6e2 100644 --- a/bitnami/magento/2/debian-10/rootfs/opt/bitnami/scripts/libmagento.sh +++ b/bitnami/magento/2/debian-10/rootfs/opt/bitnami/scripts/libmagento.sh @@ -355,8 +355,12 @@ magento_initialize() { fi # Perform database schema upgrade - info "Upgrading database schema" - magento_execute setup:upgrade + if ! is_boolean_yes "$MAGENTO_KEEP_STATIC" && [[ "$MAGENTO_MODE" != "production" ]]; then + info "Upgrading database schema" + magento_execute setup:upgrade + else + magento_execute setup:upgrade --keep-generated + fi fi # Magento includes a command for setting up the cron jobs via the 'cron:install' command diff --git a/bitnami/magento/2/debian-10/rootfs/opt/bitnami/scripts/magento-env.sh b/bitnami/magento/2/debian-10/rootfs/opt/bitnami/scripts/magento-env.sh index a6ce77c1c7f4..70ff30313fbe 100644 --- a/bitnami/magento/2/debian-10/rootfs/opt/bitnami/scripts/magento-env.sh +++ b/bitnami/magento/2/debian-10/rootfs/opt/bitnami/scripts/magento-env.sh @@ -34,6 +34,7 @@ magento_env_vars=( MAGENTO_EXTRA_INSTALL_ARGS MAGENTO_ADMIN_URL_PREFIX MAGENTO_DEPLOY_STATIC_CONTENT + MAGENTO_KEEP_STATIC MAGENTO_SKIP_REINDEX MAGENTO_SKIP_BOOTSTRAP MAGENTO_USERNAME @@ -113,6 +114,7 @@ export MAGENTO_EXTRA_INSTALL_ARGS="${MAGENTO_EXTRA_INSTALL_ARGS:-}" # only used MAGENTO_ADMIN_URL_PREFIX="${MAGENTO_ADMIN_URL_PREFIX:-"${MAGENTO_ADMINURI:-}"}" export MAGENTO_ADMIN_URL_PREFIX="${MAGENTO_ADMIN_URL_PREFIX:-admin}" # only used during the first initialization export MAGENTO_DEPLOY_STATIC_CONTENT="${MAGENTO_DEPLOY_STATIC_CONTENT:-no}" # only used during the first initialization +export MAGENTO_KEEP_STATIC="${MAGENTO_KEEP_STATIC:-no}" export MAGENTO_SKIP_REINDEX="${MAGENTO_SKIP_REINDEX:-no}" # only used during the first initialization export MAGENTO_SKIP_BOOTSTRAP="${MAGENTO_SKIP_BOOTSTRAP:-no}" # only used during the first initialization diff --git a/bitnami/magento/README.md b/bitnami/magento/README.md index da1e30e89991..81facbefc152 100644 --- a/bitnami/magento/README.md +++ b/bitnami/magento/README.md @@ -36,7 +36,6 @@ Bitnami containers can be used with [Kubeapps](https://kubeapps.com/) for deploy Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/). - * [`2`, `2-debian-10`, `2.4.4`, `2.4.4-debian-10-r27`, `latest` (2/debian-10/Dockerfile)](https://github.com/bitnami/bitnami-docker-magento/blob/2.4.4-debian-10-r27/2/debian-10/Dockerfile) Subscribe to project updates by watching the [bitnami/magento GitHub repo](https://github.com/bitnami/bitnami-docker-magento). @@ -267,6 +266,7 @@ Available environment variables: - `MAGENTO_ENABLE_HTTPS`: Whether to use SSL to access the Magento Store. Valid values: yes, no. Default: **no** - `MAGENTO_ENABLE_ADMIN_HTTPS`: Whether to use SSL to access the Magento Admin. Valid values: yes, no. Default: **no** - `MAGENTO_DEPLOY_STATIC_CONTENT`: Whether to deploy Magento static content during the initialization, to optimize initial page load time. Default: **no** +- `MAGENTO_KEEP_STATIC`: Whether to keep the content of 'pub/static' folder during the initialization. Default: **no** - `MAGENTO_SKIP_REINDEX`: Whether to skip Magento re-index during the initialization. Default: **no** - `MAGENTO_SKIP_BOOTSTRAP`: Whether to skip performing the initial bootstrapping for the application. Default: **no**