From f819369d55619a49731029de1f57e7886936d038 Mon Sep 17 00:00:00 2001 From: Marcin Dobrucki Date: Wed, 10 May 2023 10:33:11 +0000 Subject: [PATCH] [magento] Docker images updates - 2023-05-10-103311 --- 2/debian11/2.4.3/Dockerfile | 212 ------------------ 2/debian11/2.4.4/docker-entrypoint.sh | 53 ----- 2/debian11/2.4.4/etc/metrics.conf | 8 - 2/debian11/2.4.4/etc/nginx-magento.conf | 205 ----------------- 2/debian11/2.4.4/etc/php-fpm.conf | 24 -- 2/debian11/2.4.4/etc/php-fpm.ini | 15 -- 2/debian11/2.4.4/etc/supervisord.conf | 32 --- 2/debian11/2.4.4/scripts/backup.sh | 31 --- 2/debian11/2.4.4/scripts/common_functions.sh | 104 --------- 2/debian11/2.4.4/scripts/inc/hostname_fix | 61 ----- 2/debian11/2.4.4/scripts/inject_hostname.py | 97 -------- 2/debian11/2.4.4/scripts/restore.sh | 58 ----- 2/debian11/2.4.4/scripts/setup_domain.sh | 26 --- 2/debian11/2.4.4/scripts/setup_extension.sh | 36 --- 2/debian11/2.4.4/scripts/setup_functions.sh | 185 --------------- 2/debian11/2.4.4/scripts/setup_magento.sh | 82 ------- .../2.4.4/scripts/setup_secure_domain.sh | 30 --- 2/debian11/2.4.4/scripts/upgrade_magento.sh | 38 ---- 2/debian11/{2.4.4 => 2.4}/Dockerfile | 8 +- .../{2.4.3 => 2.4}/docker-entrypoint.sh | 0 2/debian11/{2.4.3 => 2.4}/etc/metrics.conf | 0 .../{2.4.3 => 2.4}/etc/nginx-magento.conf | 0 2/debian11/{2.4.3 => 2.4}/etc/php-fpm.conf | 0 2/debian11/{2.4.3 => 2.4}/etc/php-fpm.ini | 0 .../{2.4.3 => 2.4}/etc/supervisord.conf | 0 2/debian11/{2.4.3 => 2.4}/scripts/backup.sh | 0 .../scripts/common_functions.sh | 0 .../{2.4.3 => 2.4}/scripts/inc/hostname_fix | 0 .../{2.4.3 => 2.4}/scripts/inject_hostname.py | 0 2/debian11/{2.4.3 => 2.4}/scripts/restore.sh | 0 .../{2.4.3 => 2.4}/scripts/setup_domain.sh | 0 .../{2.4.3 => 2.4}/scripts/setup_extension.sh | 0 .../{2.4.3 => 2.4}/scripts/setup_functions.sh | 0 .../{2.4.3 => 2.4}/scripts/setup_magento.sh | 0 .../scripts/setup_secure_domain.sh | 0 .../{2.4.3 => 2.4}/scripts/upgrade_magento.sh | 0 versions.yaml | 35 +-- 37 files changed, 11 insertions(+), 1329 deletions(-) delete mode 100644 2/debian11/2.4.3/Dockerfile delete mode 100644 2/debian11/2.4.4/docker-entrypoint.sh delete mode 100644 2/debian11/2.4.4/etc/metrics.conf delete mode 100644 2/debian11/2.4.4/etc/nginx-magento.conf delete mode 100644 2/debian11/2.4.4/etc/php-fpm.conf delete mode 100644 2/debian11/2.4.4/etc/php-fpm.ini delete mode 100644 2/debian11/2.4.4/etc/supervisord.conf delete mode 100644 2/debian11/2.4.4/scripts/backup.sh delete mode 100644 2/debian11/2.4.4/scripts/common_functions.sh delete mode 100644 2/debian11/2.4.4/scripts/inc/hostname_fix delete mode 100644 2/debian11/2.4.4/scripts/inject_hostname.py delete mode 100644 2/debian11/2.4.4/scripts/restore.sh delete mode 100644 2/debian11/2.4.4/scripts/setup_domain.sh delete mode 100644 2/debian11/2.4.4/scripts/setup_extension.sh delete mode 100644 2/debian11/2.4.4/scripts/setup_functions.sh delete mode 100644 2/debian11/2.4.4/scripts/setup_magento.sh delete mode 100644 2/debian11/2.4.4/scripts/setup_secure_domain.sh delete mode 100644 2/debian11/2.4.4/scripts/upgrade_magento.sh rename 2/debian11/{2.4.4 => 2.4}/Dockerfile (96%) rename 2/debian11/{2.4.3 => 2.4}/docker-entrypoint.sh (100%) rename 2/debian11/{2.4.3 => 2.4}/etc/metrics.conf (100%) rename 2/debian11/{2.4.3 => 2.4}/etc/nginx-magento.conf (100%) rename 2/debian11/{2.4.3 => 2.4}/etc/php-fpm.conf (100%) rename 2/debian11/{2.4.3 => 2.4}/etc/php-fpm.ini (100%) rename 2/debian11/{2.4.3 => 2.4}/etc/supervisord.conf (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/backup.sh (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/common_functions.sh (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/inc/hostname_fix (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/inject_hostname.py (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/restore.sh (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/setup_domain.sh (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/setup_extension.sh (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/setup_functions.sh (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/setup_magento.sh (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/setup_secure_domain.sh (100%) rename 2/debian11/{2.4.3 => 2.4}/scripts/upgrade_magento.sh (100%) diff --git a/2/debian11/2.4.3/Dockerfile b/2/debian11/2.4.3/Dockerfile deleted file mode 100644 index 1150369..0000000 --- a/2/debian11/2.4.3/Dockerfile +++ /dev/null @@ -1,212 +0,0 @@ -# Copyright 2022 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -FROM marketplace.gcr.io/google/php7-fpm:7.4 - -ENV DEBUG_DOCKER_ENTRYPOINT false - -ENV MAGENTO_ADMIN_EMAIL noreply@admin.example -ENV MAGENTO_HOSTNAME localhost -ENV MAGENTO_RUN_MODE production -ENV ENABLE_CRONJOBS true - -ENV MAGENTO_SHA256 23314c7495507db06d0d599369b3cc06e41b2ed9f3ba3736758bc33370801a5e -ENV MAGENTO_VERSION 2.4.3 -ENV C2D_RELEASE 2.4.3 - -ENV MAGENTO_MYSQL_DB magento -ENV MAGENTO_MYSQL_HOST localhost -ENV MAGENTO_MYSQL_PORT 3306 - -ENV MAGENTO_REDIS_HOST localhost -ENV MAGENTO_REDIS_PORT 6379 - -ENV SODIUM_SHA256 b7292dd1da67a049c8e78415cd498ec138d194cfdb302e716b08d26b80fecc10 -ENV SODIUM_VERSION 1.0.18 - -ENV COMPOSER_SHA256 1f210b9037fcf82670d75892dfc44400f13fe9ada7af9e787f93e50e3b764111 -ENV COMPOSER_VERSION 1.9.1 - -ENV NGINX_VERSION 1.18.0 - -ENV PHP_MEMORY_LIMIT 2G -ENV PHP_UPLOAD_SIZE 64M - -# Install dependencies -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y --no-install-recommends \ - apt-utils \ - cron \ - gettext-base \ - git \ - jq \ - libbz2-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libfreetype6-dev \ - libgeoip-dev \ - python \ - wget \ - libgmp-dev \ - libmagickwand-dev \ - libmagickcore-dev \ - libc-client-dev \ - libkrb5-dev \ - libicu-dev \ - libldap2-dev \ - libpspell-dev \ - librecode0 \ - librecode-dev \ - libtidy-dev \ - libxslt1-dev \ - libyaml-dev \ - libzip-dev \ - mariadb-client \ - nginx=${NGINX_VERSION}* \ - procps \ - pwgen \ - sudo \ - supervisor \ - unzip \ - zip \ - && rm -rf /var/lib/apt/lists/* - -RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \ - && docker-php-ext-configure imap --with-kerberos --with-imap-ssl \ - && docker-php-ext-configure opcache --enable-opcache - -RUN docker-php-ext-install -j$(nproc) \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - imap \ - intl \ - ldap \ - mysqli \ - opcache \ - pdo_mysql \ - pspell \ - shmop \ - soap \ - sockets \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xmlrpc \ - xsl \ - zip \ - pcntl - -RUN pecl install -o -f \ - geoip-1.1.1 \ - igbinary \ - imagick \ - propro \ - mailparse \ - msgpack \ - oauth \ - raphf \ - redis \ - yaml - -# Install Sodium, a Magento requirement after version 2.3.2 -RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \ - && rm -f /usr/local/lib/php/extensions/*/*sodium.so \ - && apt-get remove libsodium* -y \ - && mkdir -p /tmp/libsodium \ - && curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \ - && cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \ - && ./configure \ - && make && make check \ - && make install \ - && cd / \ - && rm -rf /tmp/libsodium \ - && pecl install -o -f libsodium - -# Enable PHP extensions -RUN docker-php-ext-enable \ - bcmath \ - bz2 \ - calendar \ - exif \ - gd \ - gettext \ - gmp \ - imap \ - intl \ - ldap \ - mailparse \ - msgpack \ - mysqli \ - oauth \ - opcache \ - pdo_mysql \ - pspell \ - raphf \ - redis \ - shmop \ - soap \ - sockets \ - sodium \ - sysvmsg \ - sysvsem \ - sysvshm \ - tidy \ - xmlrpc \ - igbinary \ - imagick \ - propro \ - xsl \ - yaml \ - zip \ - pcntl - -# Copy configuration files and scripts -COPY etc/php-fpm.ini /usr/local/etc/php/conf.d/zz-magento.ini -COPY etc/php-fpm.conf /usr/local/etc/ -COPY etc/nginx-magento.conf /etc/nginx/sites-enabled/magento -COPY etc/metrics.conf /etc/nginx/sites-enabled/metrics -COPY etc/supervisord.conf /etc/supervisor/conf.d/supervisor.conf - -# Copy script files -ADD scripts/*.sh /usr/local/bin/ -COPY scripts/inject_hostname.py /scripts/inject_hostname.py -COPY scripts/inc/hostname_fix /scripts/inc/hostname_fix -COPY docker-entrypoint.sh /docker-entrypoint.sh - -RUN chmod +x /docker-entrypoint.sh \ - && chmod +x /usr/local/bin/*.sh - -# Install Composer (PHP package manager) -RUN set -e \ - && cd /usr/local/bin \ - && curl -o composer.phar "https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar" \ - && echo "${COMPOSER_SHA256} composer.phar" | sha256sum -c - \ - && chmod +x composer.phar - -VOLUME /app - -WORKDIR /magento - -# Download and install Magento libraries via Composer -RUN curl -L -o magento.tar.gz https://api.github.com/repos/magento/magento2/tarball/${MAGENTO_VERSION} \ - && test "$(sha256sum magento.tar.gz | awk {'print $1'})" = ${MAGENTO_SHA256} \ - && tar -xf magento.tar.gz -C /magento --strip-components=1 \ - && rm -f magento.tar.gz \ - && composer.phar install - -WORKDIR /app - -EXPOSE 80 8080 - -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["supervisord", "--nodaemon", "--configuration", "/etc/supervisor/conf.d/supervisor.conf"] diff --git a/2/debian11/2.4.4/docker-entrypoint.sh b/2/debian11/2.4.4/docker-entrypoint.sh deleted file mode 100644 index ff68226..0000000 --- a/2/debian11/2.4.4/docker-entrypoint.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -# Supervisor config file location -CONFIG_FILES=( - "/usr/local/etc/php-fpm.conf" \ - "/usr/local/etc/php/conf.d/zz-magento.ini" \ - "/etc/nginx/sites-enabled/magento" \ - "/etc/supervisor/conf.d/supervisor.conf" \ -) - -source /usr/local/bin/common_functions.sh - -# Enable bash debug if DEBUG_DOCKER_ENTRYPOINT exists -if [[ "${DEBUG_DOCKER_ENTRYPOINT}" = "true" ]]; then - echo "!!! WARNING: DEBUG_DOCKER_ENTRYPOINT is enabled!" - echo "!!! WARNING: Use only for debugging. Do not use in production!" - set -x - env -fi - -# Iterate over all the config files, as follows: -# PHP-FPM service, PHP-FPM - Magento related settings -# NGINX and Supervisor config -for FILE in ${CONFIG_FILES[@]}; do - replace_magento_vars "${FILE}" -done - -# Remove default nginx config -if [[ -f /etc/nginx/sites-enabled/default ]]; then - rm -f /etc/nginx/sites-enabled/default -fi - -# Install Magento and PHP Dependencies -# If it fails, breaks the execution -setup_magento.sh -if [[ "$?" -ne 0 ]]; then - echo >&2 "Failure during Magento setup." - exit 1 -fi - -# For security reasons, remove write permissions from these directories -if [[ -d /app/app/etc ]]; then - chmod -f 664 -R /app/app/etc -fi - -echo "Starting container..." -exec "$@" diff --git a/2/debian11/2.4.4/etc/metrics.conf b/2/debian11/2.4.4/etc/metrics.conf deleted file mode 100644 index 724f8fd..0000000 --- a/2/debian11/2.4.4/etc/metrics.conf +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen 8080; - location /stub_status { - stub_status on; - access_log off; - allow 127.0.0.1; - } -} \ No newline at end of file diff --git a/2/debian11/2.4.4/etc/nginx-magento.conf b/2/debian11/2.4.4/etc/nginx-magento.conf deleted file mode 100644 index ebe90b9..0000000 --- a/2/debian11/2.4.4/etc/nginx-magento.conf +++ /dev/null @@ -1,205 +0,0 @@ -upstream fastcgi_backend { - server localhost:9000; -} - -server { - listen 80; - - server_name localhost; - - set $MAGE_ROOT /app; - set $MAGE_MODE ${MAGENTO_RUN_MODE}; - - # Disable support for SSL termination by default - set $my_http "http"; - set $my_ssl "off"; - set $my_port "80"; - - root $MAGE_ROOT/pub; - - index index.php; - autoindex off; - charset UTF-8; - client_max_body_size ${PHP_UPLOAD_SIZE}; # Max upload size - error_page 404 403 = /errors/404.php; - - # Deny access to sensitive files - location /.user.ini { - deny all; - } - - location / { - try_files /maintenance.html $uri $uri/ @handler; # If missing pass the URI to Magento's front handlerW - } - - location @handler { # Magento uses a common front handler - rewrite / /index.php; - } - location ~ .php/ { # Forward paths like /js/index.php/x.js to relevant handler - rewrite ^(.*.php)/ $1 last; - } - - location /pub/ { - location ~ ^/pub/media/(downloadable|customer|import|theme_customization/.*\.xml) { - deny all; - } - alias $MAGE_ROOT/pub/; - add_header X-Frame-Options "SAMEORIGIN"; - } - - location /static/ { - if ($MAGE_MODE = "production") { - expires max; - } - - # Remove signature of the static files that is used to overcome the browser cache - location ~ ^/static/version { - rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last; - } - - location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$ { - add_header Cache-Control "public"; - add_header X-Frame-Options "SAMEORIGIN"; - expires +1y; - - if (!-f $request_filename) { - rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last; - } - } - location ~* \.(zip|gz|gzip|bz2|csv|xml)$ { - add_header Cache-Control "no-store"; - add_header X-Frame-Options "SAMEORIGIN"; - expires off; - - if (!-f $request_filename) { - rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last; - } - } - if (!-f $request_filename) { - rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last; - } - add_header X-Frame-Options "SAMEORIGIN"; - } - - location /media/ { - try_files $uri $uri/ /get.php$is_args$args; - - location ~ ^/media/theme_customization/.*\.xml { - deny all; - } - - location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ { - add_header Cache-Control "public"; - add_header X-Frame-Options "SAMEORIGIN"; - expires +1y; - try_files $uri $uri/ /get.php$is_args$args; - } - location ~* \.(zip|gz|gzip|bz2|csv|xml)$ { - add_header Cache-Control "no-store"; - add_header X-Frame-Options "SAMEORIGIN"; - expires off; - try_files $uri $uri/ /get.php$is_args$args; - } - add_header X-Frame-Options "SAMEORIGIN"; - } - - location /media/customer/ { - deny all; - } - - location /media/downloadable/ { - deny all; - } - - location /media/import/ { - deny all; - } - - location /errors/ { - location ~* \.xml$ { - deny all; - } - } - - location /setup { - root $MAGE_ROOT; - location ~ ^/setup/index.php { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass fastcgi_backend; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } - - location ~ ^/setup/(?!pub/). { - deny all; - } - - location ~ ^/setup/pub/ { - add_header X-Frame-Options "SAMEORIGIN"; - } - } - - location /update { - root $MAGE_ROOT; - location ~ ^/update/index.php { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass fastcgi_backend; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } - - location ~ ^/update/(?!pub/). { - deny all; - } - - location ~ ^/update/pub/ { - add_header X-Frame-Options "SAMEORIGIN"; - } - } - - # PHP entry point for main application - location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ { - try_files $uri =404; - fastcgi_pass fastcgi_backend; - fastcgi_buffers 1024 4k; - - fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; - fastcgi_param PHP_VALUE "memory_limit=${PHP_MEMORY_LIMIT} \n max_execution_time=18000"; - fastcgi_read_timeout 10s; - fastcgi_connect_timeout 10s; - fastcgi_param MAGE_MODE $MAGE_MODE; - fastcgi_param HTTPS $my_ssl; - - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } - - gzip on; - gzip_disable "msie6"; - - gzip_comp_level 6; - gzip_min_length 1100; - gzip_buffers 16 8k; - gzip_proxied any; - gzip_types - text/plain - text/css - text/js - text/xml - text/javascript - application/javascript - application/x-javascript - application/json - application/xml - application/xml+rss - image/svg+xml; - gzip_vary on; - - # Banned locations (only reached if the earlier PHP entry point regexes don't match) - location ~* (\.php$|\.htaccess$|\.git) { - deny all; - } -} diff --git a/2/debian11/2.4.4/etc/php-fpm.conf b/2/debian11/2.4.4/etc/php-fpm.conf deleted file mode 100644 index 57f8adc..0000000 --- a/2/debian11/2.4.4/etc/php-fpm.conf +++ /dev/null @@ -1,24 +0,0 @@ -[global] - -error_log = /proc/self/fd/2 -daemonize = no - -[www] - -; if we send this to /proc/self/fd/1, it never appears -access.log = /proc/self/fd/2 - -listen = [::]:9000 - -pm = dynamic -pm.max_children = 10 -pm.start_servers = 4 -pm.min_spare_servers = 2 -pm.max_spare_servers = 6 - -env[MAGE_MODE] = ${MAGENTO_RUN_MODE}; # Variable: MAGENTO_RUN_MODE - -clear_env = no - -; Ensure worker stdout and stderr are sent to the main error log. -catch_workers_output = yes diff --git a/2/debian11/2.4.4/etc/php-fpm.ini b/2/debian11/2.4.4/etc/php-fpm.ini deleted file mode 100644 index f61856e..0000000 --- a/2/debian11/2.4.4/etc/php-fpm.ini +++ /dev/null @@ -1,15 +0,0 @@ -memory_limit=${PHP_MEMORY_LIMIT} -opcache.enable=1 -opcache.enable_cli=1 -opcache.memory_consumption=512MB -opcache.interned_strings_buffer=8 -opcache.max_accelerated_files=60000 -opcache.validate_timestamps=0 -opcache.consistency_check=0 -opcache.revalidate_freq=2 -opcache.fast_shutdown=1 -catch_workers_output=yes - -php_flag[display_errors]=off -php_admin_value[error_log]=/var/log/fpm-php.www.log -php_admin_flag[log_errors]=on diff --git a/2/debian11/2.4.4/etc/supervisord.conf b/2/debian11/2.4.4/etc/supervisord.conf deleted file mode 100644 index 885b075..0000000 --- a/2/debian11/2.4.4/etc/supervisord.conf +++ /dev/null @@ -1,32 +0,0 @@ -[unix_http_server] -file=/var/run/supervisor.sock - -[supervisorctl] -serverurl=unix:///var/run/supervisor.sock - -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisord] -logfile=redirect_stdout -loglevel=info -user=root - -[program:php] -command=php-fpm -R -autorestart=true -autostart=true -priority=1 - -[program:cron] -command=cron -f -autostart=${ENABLE_CRONJOBS} -autorestart=true -priority=2 - -[program:nginx] -command=nginx -g "daemon off;" -autorestart=true -autostart=true -startsecs=30 -priority=999 diff --git a/2/debian11/2.4.4/scripts/backup.sh b/2/debian11/2.4.4/scripts/backup.sh deleted file mode 100644 index aec3617..0000000 --- a/2/debian11/2.4.4/scripts/backup.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -set -e - -# Ensure backup feature is enabled -bin/magento config:set system/backup/functionality_enabled 1 --quiet - -# Backup data, code and files. -BKP_OUTPUT="$(bin/magento setup:backup --code --db --media 2>&1)" - -# Gets the backup pathes from Magento CLI Output -# Filters only numbers, get the one which appears in first row -BACKUP_ID="$(echo ${BKP_OUTPUT} | grep -o -E "([0-9]*)" | nl | awk '{if ($1 == "1") print $2}')" - -# Outputs to the end user -if [[ ! -z "${BACKUP_ID}" ]]; then - echo "${BACKUP_ID}" -else - echo "Failure backing up data." - exit 1 -fi - -# Hiding error so the developer who is using backup.sh can -# get BACKUP_ID properly -bin/magento maintenance:disable 2>&1 > /dev/null diff --git a/2/debian11/2.4.4/scripts/common_functions.sh b/2/debian11/2.4.4/scripts/common_functions.sh deleted file mode 100644 index e72ebd3..0000000 --- a/2/debian11/2.4.4/scripts/common_functions.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/bash -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -# Responsible for replacing environment variables in a source file -# using envsubst -function replace_magento_vars() { - local SOURCE_FILE="$1" - local VARS="\$MAGENTO_RUN_MODE \$PHP_MEMORY_LIMIT \$PHP_UPLOAD_SIZE \$ENABLE_CRONJOBS" - local TEMP_OUTPUT - local RET_VAL - - # Check if source file exists - if [[ ! -f ${SOURCE_FILE} ]]; then - echo >&2 "File ${SOURCE_FILE} not found." - exit 1 - fi - - # Replace variables from temp variable and - # outputs to the source file - TEMP_OUTPUT=$(cat ${SOURCE_FILE} | envsubst "${VARS}") - echo -n "${TEMP_OUTPUT}" > "${SOURCE_FILE}" - - # If it fails, exit with error, otherwise exit with success. - if [[ "$?" -ne 0 ]]; then - exit_with_error "Error parsing file." - fi -} - - -# Responsible for testing all required fields -# If at least one required field is missing, script should be aborted -# User should be notified about the missing fields -# Returns true if all fields are valid, otherwise false -# -# Examples: -# - Test with missing fields: -# -# export FIRST_NAME="John" -# export LAST_NAME="" -# REQUIRED_FIELDS=( -# "FIRST_NAME" -# "LAST_NAME" -# "AGE" -# ) -# echo "Result is: $(validate_required_fields)" -# # => Outputs: -# The following fields are required: -# - LAST_NAME -# - AGE -# Result is: false -# -# - Test with valid fields: -# -# export FIRST_NAME="John" -# export LAST_NAME="Doe" -# export AGE=40 -# REQUIRED_FIELDS=( -# "FIRST_NAME" -# "LAST_NAME" -# "AGE" -# ) -# echo "Result is: $(validate_required_fields)" -# # => Outputs: -# Result is: true -function validate_required_fields() { - local FIELDS_TO_VALIDATE=("$@") - local FIELDS_NON_FILLED=() - local FIELD_VALUE - - # Validates field by field and add to errors if it is not filled. - for field in "${FIELDS_TO_VALIDATE[@]}"; do - FIELD_VALUE=$(eval echo "\$$field") - if [[ -z $FIELD_VALUE ]]; then - FIELDS_NON_FILLED+=(${field}) - fi - done - - # Exits if there are some missing field. - if [[ ${#FIELDS_NON_FILLED[@]} -gt 0 ]]; then - echo >&2 "The following fields are required:" - for field in "${FIELDS_NON_FILLED[@]}"; do - echo >&2 "- ${field}"; - done - echo false - else - echo true - fi -} - -# Exit raising an error. -# Responsible for exit the function and send a message to stderr -# The function expects the message as the first parameter. -function exit_with_error() { - echo >&2 $1 - if [[ -f bin/magento ]]; then - bin/magento maintenance:disable - fi - exit 1 -} diff --git a/2/debian11/2.4.4/scripts/inc/hostname_fix b/2/debian11/2.4.4/scripts/inc/hostname_fix deleted file mode 100644 index abfdc95..0000000 --- a/2/debian11/2.4.4/scripts/inc/hostname_fix +++ /dev/null @@ -1,61 +0,0 @@ -/* This file is a patch to Magento entrypoint PHP file -> /app/pub/index.php - The purpose of this patch is updating the base_url which is stored in Magento core_config_data table - based on the HTTP_HOST received in the request and this way provide an access from any hostname. - - Its worth to remember that in order to PHP receive this request, all the way since the client up to - webserver (Domain, Proxy and/or CDN) should be well-configured. */ - -use \Magento\Framework\App\ObjectManager; -use \Psr\Log\LoggerInterface; - -# Get current base_url -$objectManager = $bootstrap->getObjectManager(); -$logger = $objectManager->get(\Psr\Log\LoggerInterface::class); - -$coreSession = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface'); - -# Build the config keys -$urlKey = "web/%s/base_url"; -$baseUrlKey = sprintf($urlKey, "unsecure"); -$secureUrlKey = sprintf($urlKey, "secure"); - -# Get current values -$baseUrl = $coreSession->getValue(sprintf($urlKey, "unsecure")); -$secureUrl = $coreSession->getValue(sprintf($urlKey, "secure")); - -# Rewrite it -$newBaseUrl = sprintf("http://%s/", $_SERVER["HTTP_HOST"]); -$newSecureUrl = sprintf("https://%s/", $_SERVER["HTTP_HOST"]); - -# If value has changed -if ($baseUrl != $newBaseUrl) { - $connection = $objectManager->create('\Magento\Framework\App\ResourceConnection'); - $conn = $connection->getConnection(); - - # Updates Base Url - $query = sprintf("update core_config_data set value = '%s' where path = '%s'", $newBaseUrl, $baseUrlKey); - $conn->query($query); - - # Updates Secure Url - $query = sprintf("update core_config_data set value = '%s' where path = '%s'", $newSecureUrl, $secureUrlKey); - $conn->query($query); - - # Clean Cache - try { - $_cacheTypeList = $objectManager->create('Magento\Framework\App\Cache\TypeListInterface'); - $_cacheFrontendPool = $objectManager->create('Magento\Framework\App\Cache\Frontend\Pool'); - $types = array( - 'config','layout','block_html','collections','reflection','db_ddl', - 'eav','config_integration','config_integration_api','full_page', - 'translate','config_webservice'); - foreach ($types as $type) { - $_cacheTypeList->cleanType($type); - } - foreach ($_cacheFrontendPool as $cacheFrontend) { - $cacheFrontend->getBackend()->clean(); - } - } catch (Exception $e){ - $logger->error("Error cleaning the cache:"); - $logger->error($e->getMessage()); - } -} diff --git a/2/debian11/2.4.4/scripts/inject_hostname.py b/2/debian11/2.4.4/scripts/inject_hostname.py deleted file mode 100644 index e8a2582..0000000 --- a/2/debian11/2.4.4/scripts/inject_hostname.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -# The purpose of this file is: -# - inject inc/hostname_fix in Magento entrypoint (app/pub/index.php) -# - and assure the patch cannot be injected more than once -# The patch is important so the user can access from a different hostname than localhost. -# Such as a public ip or even a domain if its well-configured. - -import re -import argparse - - -def get_include_contents(include_file): - """Reads the include file and returns its contents. - - Keyword arguments: - include_file -- path of the include file which will be read - """ - with open(include_file, 'r') as f: - contents = f.read() - return contents - - -def inject(source_file, include_file): - """Injects include file into the source one - - Keyword arguments: - source_file -- path of the file which will receive the injection - include_file -- path of the file which will be injected - """ - new_file = [] - should_write_file = True - - # Read source file - with open(source_file) as f: - # Iterate over all lines - for line in f: - # Try to find the point of inject - match = re.search('\$bootstrap->createApplication', line) - new_file.append(line) - - # If point of inject is found, include the injection content - if match: - new_file.append(get_include_contents(include_file)) - new_file.append('\n') - - # Try to check if source file has been already injected - match = line.find('use \\Magento\\Framework\\App\\ObjectManager;') >= 0 - - # If source file has already been injected, bypass it. - # It avoids to duplicate the patch - if match: - should_write_file = False - break - f.close() - - # Only writes the new file, if source is not patched - if should_write_file: - write_new_file(source_file, ''.join(new_file)) - - -def write_new_file(source_file, contents): - """Injects include file into the source one - - Keyword arguments: - source_file -- path of the file which will receive the injection - contents -- new content received - """ - # Write new contents on source file - with open(source_file, 'w') as f: - f.write(contents) - - -def main(): - """Application entrypoint""" - - # Declare CLI arguments and parses it - parser = argparse.ArgumentParser(description='Inject simple script') - parser.add_argument('--source') - parser.add_argument('--include') - cli_args = parser.parse_args() - - # Inject file - inject( - source_file=cli_args.source, - include_file=cli_args.include - ) - - -if __name__ == '__main__': - main() diff --git a/2/debian11/2.4.4/scripts/restore.sh b/2/debian11/2.4.4/scripts/restore.sh deleted file mode 100644 index 18b807d..0000000 --- a/2/debian11/2.4.4/scripts/restore.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -set -e - -source common_functions.sh - -BACKUP_ID=$1 -CODE_FILE="${BACKUP_ID}_filesystem_code.tgz" -MEDIA_FILE="${BACKUP_ID}_filesystem_media.tgz" -DB_FILE="${BACKUP_ID}_db.sql" - -# Declare initial state of restore -IS_REQUEST_OK=0 - -echo "Setting store to maintenance mode..." -bin/magento maintenance:enable || exit_with_error "Unable to set the store to maintenance mode." - -# Backup data, code and files. -bin/magento setup:rollback \ - --code-file "${CODE_FILE}" \ - --media-file "${MEDIA_FILE}" \ - --db-file "${DB_FILE}" \ - --no-interaction - -# If backup has not been completed with success, fail script -if [[ "$?" -ne 0 ]]; then - echo >&2 "Magento data restore has been failed." - exit 1 -fi - -# After code restore, bin/magento has the execution permission revoked -chmod +x bin/magento - -# Set the application out of maintenance -bin/magento maintenance:disable - -# Flush cache data -bin/magento cache:clean && bin/magento cache:flush - -# Test magento -IS_REQUEST_OK=$(curl -I -L http://localhost | grep "200" | wc -l) -if [[ ${IS_REQUEST_OK} -gt 0 ]]; then - echo "Magento backup has been applied successfully." -else - echo "Error during backup restore" -fi - -# If store could not be accessed, send error status -if [[ ${IS_REQUEST_OK} -eq 0 ]]; then - echo >&2 "Magento website is down." - exit 1 -fi diff --git a/2/debian11/2.4.4/scripts/setup_domain.sh b/2/debian11/2.4.4/scripts/setup_domain.sh deleted file mode 100644 index b9d8ba1..0000000 --- a/2/debian11/2.4.4/scripts/setup_domain.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -set -eu - -DOMAIN_NAME="$1" - -if [[ -z "${DOMAIN_NAME}" ]]; then - echo >&2 "DOMAIN_NAME var should be provided." - exit 1 -do - -cd /app - -bin/magento setup:store-config:set --base-url="http://${DOMAIN_NAME}/" - && bin/magento cache:flush - -echo "======================" -echo "URLs Configured." -echo "http://${DOMAIN_NAME}" -echo "======================" diff --git a/2/debian11/2.4.4/scripts/setup_extension.sh b/2/debian11/2.4.4/scripts/setup_extension.sh deleted file mode 100644 index 8e0fc00..0000000 --- a/2/debian11/2.4.4/scripts/setup_extension.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -set -eu - -EXTENSION_NAME="$1" - -if [[ -z "${EXTENSION_NAME:-}" ]]; then - echo >&2 "EXTENSION_NAME variable not provided." - exit 1 -fi - -cd /app - -# Install the extension -composer.phar require ${EXTENSION_NAME} - -# Enable all pending extensions and update dependencies -bin/magento setup:upgrade - -# Deploy static content -bin/magento setup:static-content:deploy -f - -# Compile new dependencies added to the project -bin/magento setup:di:compile - -# Clean cache -bin/magento cache:clean - -# Restarts PHP so OPCache can get the new code downloaded -supervisorctl restart php diff --git a/2/debian11/2.4.4/scripts/setup_functions.sh b/2/debian11/2.4.4/scripts/setup_functions.sh deleted file mode 100644 index 6282ca3..0000000 --- a/2/debian11/2.4.4/scripts/setup_functions.sh +++ /dev/null @@ -1,185 +0,0 @@ -#!/bin/bash -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -# Responsible for checking if Magento is already installed inside the volume -# If Magento is installed, cron should be started based on configuration -# Then script is aborted. -function is_magento_installed() { - if [[ -d /app/pub/setup ]]; then - echo true - else - echo false - fi -} - -# Responsible for checking if a host and port are listening connections -# First parameter receives a host name -# Second parameter receives a port number -function await_for_host_and_port() { - local HOST="$1" - local PORT="$2" - timeout --preserve-status 300 bash -c "until echo > /dev/tcp/${HOST}/${PORT}; do sleep 2; done" - if [[ "$?" -ne 0 ]]; then - exit 1 - fi -} - -# Responsible for awaiting the dependencies to be ready -# MySQL, Redis and Elasticsearch should be available so the setup can start. -function await_for_dependencies() { - echo "Awaiting MySQL to be ready..." >&2 - await_for_host_and_port "${MAGENTO_MYSQL_HOST}" "3306" - - echo "Awaiting Redis to be ready..." >&2 - await_for_host_and_port "${MAGENTO_REDIS_HOST}" "${MAGENTO_REDIS_PORT}" - - echo "Awaiting Elasticsearch to be ready..." >&2 - await_for_host_and_port "${MAGENTO_ELASTICSEARCH_HOST}" "${MAGENTO_ELASTICSEARCH_PORT}" -} - -# Responsible for copying an entire folder to a destination -# The usage of this function here is to copy the installation folder -# from container to a volume folder. -# If volume folder has already Magento Setup scripts by pass it -# It receives three parameters: -# First parameter - source folder -# Second parameter - destination folder -# Third parameter - lock file. If the file exists, no folder is copied. -function copy_installation_folder() { - local FROM="$1" - local TO="$2" - local LOCK_FILE="$3" - - if [[ ! -f "${LOCK_FILE}" ]]; then - echo "Magento not found in ${TO} - copying now..." >&2 - if [ "$(ls -A)" ]; then - echo "WARNING: ${TO} is not empty. Data might be overwritten." >&2 - fi - tar cf - --one-file-system -C "${FROM}" . | tar xf - - echo "Magento has been successfully copied to ${TO}" >&2 - fi -} - -# Responsible for installing Magento -function install_magento() { - # Enable debugging if MAGENTO_RUN_MODE is not production. - local DEBUG_MAGENTO="false" - if [[ "${MAGENTO_RUN_MODE}" != "production" ]]; then - echo "Debugging enabled." >&2 - DEBUG_MAGENTO="true" - fi - - # Important: If you use Redis for more than one type of caching, - # It is recommended that you assign them in different databases as follows: - # - default caching database number to 0, - # - page caching database number to 1, - # - session storage database number to 2 - # https://devdocs.magento.com/guides/v2.4/config-guide/redis/redis-session.html - - # Prepare configuration - bin/magento setup:config:set \ - --backend-frontname admin \ - --enable-debug-logging "${DEBUG_MAGENTO}" \ - --db-host "${MAGENTO_MYSQL_HOST}" \ - --db-name "${MAGENTO_MYSQL_DB}" \ - --db-user "${MAGENTO_MYSQL_USERNAME}" \ - --db-password "${MAGENTO_MYSQL_PASSWORD}" \ - --db-engine mysql \ - --session-save redis \ - --session-save-redis-host "${MAGENTO_REDIS_HOST}" \ - --session-save-redis-port "${MAGENTO_REDIS_PORT}" \ - --session-save-redis-password "${MAGENTO_REDIS_PASSWORD}" \ - --session-save-redis-persistent-id sess-db0 \ - --session-save-redis-db 2 \ - --cache-backend redis \ - --cache-backend-redis-server "${MAGENTO_REDIS_HOST}" \ - --cache-backend-redis-db 0 \ - --cache-backend-redis-port "${MAGENTO_REDIS_PORT}" \ - --cache-backend-redis-password "${MAGENTO_REDIS_PASSWORD}" \ - --page-cache redis \ - --page-cache-redis-server "${MAGENTO_REDIS_HOST}" \ - --page-cache-redis-db 1 \ - --page-cache-redis-port "${MAGENTO_REDIS_PORT}" \ - --page-cache-redis-password "${MAGENTO_REDIS_PASSWORD}" \ - --no-interaction - - # Install components - bin/magento setup:install \ - --search-engine elasticsearch7 \ - --elasticsearch-host "${MAGENTO_ELASTICSEARCH_HOST}" \ - --elasticsearch-port "${MAGENTO_ELASTICSEARCH_PORT}" \ - --elasticsearch-index-prefix magento - bin/magento setup:upgrade - - # Compile static assets - bin/magento setup:static-content:deploy -f - - # Setup magento for accepting ssl - bin/magento setup:store-config:set \ - --use-secure=1 \ - --use-secure-admin=1 -} - -# Responsible for creating the first admin user -# based on previously set variables -function create_admin_user() { - # MAGENTO_ADMIN_USERNAME is being used intentionally in Admin First ans Last Names - # so the Administrator User can be created using the less configurations as possible. - bin/magento admin:user:create \ - --admin-user="${MAGENTO_ADMIN_USERNAME}" \ - --admin-password="${MAGENTO_ADMIN_PASSWORD}" \ - --admin-email="${MAGENTO_ADMIN_EMAIL}" \ - --admin-firstname="${MAGENTO_ADMIN_USERNAME}" \ - --admin-lastname="${MAGENTO_ADMIN_USERNAME}" -} - -# Responsible for injecting a patch in Magento PHP entrypoint -# so website can be accessed immediately after the deployment. -function inject_patch_hostname() { - local MAGENTO_ENTRYPOINT="/app/pub/index.php" - local INCLUDE_FILE="/scripts/inc/hostname_fix" - - python /scripts/inject_hostname.py \ - --source "${MAGENTO_ENTRYPOINT}" \ - --include "${INCLUDE_FILE}" -} - -# Responsible for enabling crontab or not -# If first parameter = true, Magento cron tabs are installed. -function install_magento_crontab() { - local ENABLED="$1" - - if [[ "${ENABLED}" = "true" ]]; then - # Apply Magento Crontab - bin/magento cron:install --force - fi -} - -# Responsible for preparing Magento to run properly and -# without warnings. -# It reindexes the MySQL database, initilizes Redis databases -# cleans the cache and prepares web wizard setup -function prepare_magento_for_production() { - # Reindex database - bin/magento indexer:reindex - - # Clean cached data - bin/magento cache:clean - - # Inject hostname fix. This is important so the user can access the website - # exactly after the deployment - inject_patch_hostname - - # Apply Magento crontab jobs - install_magento_crontab "${ENABLE_CRONJOBS}" - - # Symbolic link to enable Setup App on Admin page. - if [[ ! -f /app/pub/setup ]]; then - ln -s /app/setup/ /app/pub/setup - fi -} diff --git a/2/debian11/2.4.4/scripts/setup_magento.sh b/2/debian11/2.4.4/scripts/setup_magento.sh deleted file mode 100644 index 85764c4..0000000 --- a/2/debian11/2.4.4/scripts/setup_magento.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -set -eu - -# Default values -: ${MAGENTO_MYSQL_DB:=magento} -: ${MAGENTO_ADMIN_USERNAME:=admin} -: ${MAGENTO_RUN_MODE:=production} - -# Defines the list of all required fields to this script run properly -REQUIRED_FIELDS=( \ - "MAGENTO_MYSQL_HOST" \ - "MAGENTO_REDIS_HOST" \ - "MAGENTO_REDIS_PORT" \ - "MAGENTO_REDIS_PASSWORD" \ - "MAGENTO_MYSQL_USERNAME" \ - "MAGENTO_MYSQL_PASSWORD" \ - "MAGENTO_ELASTICSEARCH_HOST" \ - "MAGENTO_ELASTICSEARCH_PORT" \ - "MAGENTO_ADMIN_EMAIL" \ - "ENABLE_CRONJOBS" -) - -source /usr/local/bin/common_functions.sh -source /usr/local/bin/setup_functions.sh - - -# 1. Preparing the installation -> - -# Check if Magento is already installed -if [[ "$(is_magento_installed)" = "true" ]]; then - echo "Magento is already installed." - exit 0 -fi - -# If some field is not valid, quit -if [[ "$(validate_required_fields ${REQUIRED_FIELDS[@]})" != "true" ]]; then - exit_with_error "Required fields are missing." -fi - -# Check if password has been set, if not, generates a random one. -if [[ -z "${MAGENTO_ADMIN_PASSWORD:-}" ]]; then - MAGENTO_ADMIN_PASSWORD=$(pwgen 10 1 | tr -d "\n") - echo "New Admin Password has been generated." - echo "Password: ${MAGENTO_ADMIN_PASSWORD}" -fi - -# Await Redis, MySQL and Elasticsearch. Once both are up, the setup continues. -await_for_dependencies - -# 2. Installing Magento -> - -# Copy installation folder from built container to a volume folder -# This should be done, so installed Magento can be contained in a PVC -# in a K8S application -CURRENT_FOLDER="$(pwd)" -copy_installation_folder /magento "${CURRENT_FOLDER}" composer.json - -# Install Magento and Magento database -install_magento - -# Create first administrator user -create_admin_user - -# 3. Preparing the production access -> - -# Prepare Magento Database Indexes, cache cleaning and web wizard setup app -prepare_magento_for_production - -echo "==================================" -echo " Magento Succesfully Installed" -echo "----------------------------------" -echo " Username: ${MAGENTO_ADMIN_USERNAME}" -echo " Password: ${MAGENTO_ADMIN_PASSWORD}" -echo "-> $(bin/magento info:adminuri| tr -d "\n")" -echo "==================================" diff --git a/2/debian11/2.4.4/scripts/setup_secure_domain.sh b/2/debian11/2.4.4/scripts/setup_secure_domain.sh deleted file mode 100644 index e7ba121..0000000 --- a/2/debian11/2.4.4/scripts/setup_secure_domain.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -set -eu - -DOMAIN_NAME="$1" - -if [[ -z "${DOMAIN_NAME}" ]]; then - echo >&2 "DOMAIN_NAME var should be provided." - exit 1 -fi - -cd /app - -bin/magento setup:store-config:set \ - --base-url-secure="https://${DOMAIN_NAME}/" \ - --use-secure=1 \ - --use-secure-admin=1 - -bin/magento cache:flush - -echo "======================" -echo "URLs Configured." -echo "https://${DOMAIN_NAME}" -echo "======================" diff --git a/2/debian11/2.4.4/scripts/upgrade_magento.sh b/2/debian11/2.4.4/scripts/upgrade_magento.sh deleted file mode 100644 index 9126e6e..0000000 --- a/2/debian11/2.4.4/scripts/upgrade_magento.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# -# Copyright 2019 Google LLC -# -# This software is licensed under the Open Software License version -# 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 -# or in the file LICENSE which is distributed along with the software. - -set -eu - -source /usr/local/bin/common_functions.sh - -cd /app - -echo "Setting store to maintenance mode..." -bin/magento maintenance:enable || exit_with_error "Unable to set the store to maintenance mode." - -echo "Upgrading PHP dependencies..." -composer.phar update || exit_with_error "Unable to update PHP dependencies." - -echo "Upgrading Magento..." -bin/magento setup:upgrade || exit_with_error "Unable to upgrade Magento..." - -echo "Compiling Magento code and extensions...\ " -php bin/magento setup:di:compile || exit_with_error "Unable to upgrade Magento..." - -echo "Compiling static assets..." -bin/magento setup:static-content:deploy -f || exit_with_error "Unable to compile static assets." - -echo "Cleaning the cache..." -bin/magento cache:clean || exit_with_error "Unable to clean the cache." - -echo "Restarting PHP-FPM..." -supervisorctl restart php || exit_with_error "Unable to restart PHP-FPM." - -echo "Disabling maintenance mode and enabling the store for all visitors..." -bin/magento maintenance:disable -echo "Magento has been updated successfully." diff --git a/2/debian11/2.4.4/Dockerfile b/2/debian11/2.4/Dockerfile similarity index 96% rename from 2/debian11/2.4.4/Dockerfile rename to 2/debian11/2.4/Dockerfile index 9157a13..8c962b3 100644 --- a/2/debian11/2.4.4/Dockerfile +++ b/2/debian11/2.4/Dockerfile @@ -4,7 +4,7 @@ # 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 # or in the file LICENSE which is distributed along with the software. -FROM marketplace.gcr.io/google/php8-fpm:8.1 +FROM marketplace.gcr.io/google/php7-fpm:7.4 ENV DEBUG_DOCKER_ENTRYPOINT false @@ -13,9 +13,9 @@ ENV MAGENTO_HOSTNAME localhost ENV MAGENTO_RUN_MODE production ENV ENABLE_CRONJOBS true -ENV MAGENTO_SHA256 ef4c4d5cdf60cbc5d6a1d6f68770054d85127e4fbdb38ef16ad8997eb2573941 -ENV MAGENTO_VERSION 2.4.4 -ENV C2D_RELEASE 2.4.4 +ENV MAGENTO_SHA256 641479a30ccce81618f38294e98af4aec1e870de066f04f6c7038125a0948bfb +ENV MAGENTO_VERSION 2.4.5 +ENV C2D_RELEASE 2.4.5 ENV MAGENTO_MYSQL_DB magento ENV MAGENTO_MYSQL_HOST localhost diff --git a/2/debian11/2.4.3/docker-entrypoint.sh b/2/debian11/2.4/docker-entrypoint.sh similarity index 100% rename from 2/debian11/2.4.3/docker-entrypoint.sh rename to 2/debian11/2.4/docker-entrypoint.sh diff --git a/2/debian11/2.4.3/etc/metrics.conf b/2/debian11/2.4/etc/metrics.conf similarity index 100% rename from 2/debian11/2.4.3/etc/metrics.conf rename to 2/debian11/2.4/etc/metrics.conf diff --git a/2/debian11/2.4.3/etc/nginx-magento.conf b/2/debian11/2.4/etc/nginx-magento.conf similarity index 100% rename from 2/debian11/2.4.3/etc/nginx-magento.conf rename to 2/debian11/2.4/etc/nginx-magento.conf diff --git a/2/debian11/2.4.3/etc/php-fpm.conf b/2/debian11/2.4/etc/php-fpm.conf similarity index 100% rename from 2/debian11/2.4.3/etc/php-fpm.conf rename to 2/debian11/2.4/etc/php-fpm.conf diff --git a/2/debian11/2.4.3/etc/php-fpm.ini b/2/debian11/2.4/etc/php-fpm.ini similarity index 100% rename from 2/debian11/2.4.3/etc/php-fpm.ini rename to 2/debian11/2.4/etc/php-fpm.ini diff --git a/2/debian11/2.4.3/etc/supervisord.conf b/2/debian11/2.4/etc/supervisord.conf similarity index 100% rename from 2/debian11/2.4.3/etc/supervisord.conf rename to 2/debian11/2.4/etc/supervisord.conf diff --git a/2/debian11/2.4.3/scripts/backup.sh b/2/debian11/2.4/scripts/backup.sh similarity index 100% rename from 2/debian11/2.4.3/scripts/backup.sh rename to 2/debian11/2.4/scripts/backup.sh diff --git a/2/debian11/2.4.3/scripts/common_functions.sh b/2/debian11/2.4/scripts/common_functions.sh similarity index 100% rename from 2/debian11/2.4.3/scripts/common_functions.sh rename to 2/debian11/2.4/scripts/common_functions.sh diff --git a/2/debian11/2.4.3/scripts/inc/hostname_fix b/2/debian11/2.4/scripts/inc/hostname_fix similarity index 100% rename from 2/debian11/2.4.3/scripts/inc/hostname_fix rename to 2/debian11/2.4/scripts/inc/hostname_fix diff --git a/2/debian11/2.4.3/scripts/inject_hostname.py b/2/debian11/2.4/scripts/inject_hostname.py similarity index 100% rename from 2/debian11/2.4.3/scripts/inject_hostname.py rename to 2/debian11/2.4/scripts/inject_hostname.py diff --git a/2/debian11/2.4.3/scripts/restore.sh b/2/debian11/2.4/scripts/restore.sh similarity index 100% rename from 2/debian11/2.4.3/scripts/restore.sh rename to 2/debian11/2.4/scripts/restore.sh diff --git a/2/debian11/2.4.3/scripts/setup_domain.sh b/2/debian11/2.4/scripts/setup_domain.sh similarity index 100% rename from 2/debian11/2.4.3/scripts/setup_domain.sh rename to 2/debian11/2.4/scripts/setup_domain.sh diff --git a/2/debian11/2.4.3/scripts/setup_extension.sh b/2/debian11/2.4/scripts/setup_extension.sh similarity index 100% rename from 2/debian11/2.4.3/scripts/setup_extension.sh rename to 2/debian11/2.4/scripts/setup_extension.sh diff --git a/2/debian11/2.4.3/scripts/setup_functions.sh b/2/debian11/2.4/scripts/setup_functions.sh similarity index 100% rename from 2/debian11/2.4.3/scripts/setup_functions.sh rename to 2/debian11/2.4/scripts/setup_functions.sh diff --git a/2/debian11/2.4.3/scripts/setup_magento.sh b/2/debian11/2.4/scripts/setup_magento.sh similarity index 100% rename from 2/debian11/2.4.3/scripts/setup_magento.sh rename to 2/debian11/2.4/scripts/setup_magento.sh diff --git a/2/debian11/2.4.3/scripts/setup_secure_domain.sh b/2/debian11/2.4/scripts/setup_secure_domain.sh similarity index 100% rename from 2/debian11/2.4.3/scripts/setup_secure_domain.sh rename to 2/debian11/2.4/scripts/setup_secure_domain.sh diff --git a/2/debian11/2.4.3/scripts/upgrade_magento.sh b/2/debian11/2.4/scripts/upgrade_magento.sh similarity index 100% rename from 2/debian11/2.4.3/scripts/upgrade_magento.sh rename to 2/debian11/2.4/scripts/upgrade_magento.sh diff --git a/versions.yaml b/versions.yaml index 6d31815..2a9d4e2 100644 --- a/versions.yaml +++ b/versions.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # This software is licensed under the Open Software License version # 3.0. The full text of this license can be found in https://opensource.org/licenses/OSL-3.0 @@ -8,48 +8,27 @@ cloudbuild: enable_parallel: false versions: -- dir: 2/debian11/2.4.3 +- dir: 2/debian11/2.4 from: marketplace.gcr.io/google/php7-fpm:7.4 packages: composer: gpg: 1f210b9037fcf82670d75892dfc44400f13fe9ada7af9e787f93e50e3b764111 version: 1.9.1 magento: - sha256: 23314c7495507db06d0d599369b3cc06e41b2ed9f3ba3736758bc33370801a5e - version: 2.4.3 + sha256: 641479a30ccce81618f38294e98af4aec1e870de066f04f6c7038125a0948bfb + version: 2.4.5 nginx: version: 1.18.0 sodium: sha256: b7292dd1da67a049c8e78415cd498ec138d194cfdb302e716b08d26b80fecc10 version: 1.0.18 - php: - version: 7.4 repo: magento2-php7-fpm tags: - - 2.4.3-debian11 - - 2.4.3 -- dir: 2/debian11/2.4.4 - from: marketplace.gcr.io/google/php8-fpm:8.1 - packages: - composer: - gpg: 1f210b9037fcf82670d75892dfc44400f13fe9ada7af9e787f93e50e3b764111 - version: 1.9.1 - magento: - sha256: ef4c4d5cdf60cbc5d6a1d6f68770054d85127e4fbdb38ef16ad8997eb2573941 - version: 2.4.4 - nginx: - version: 1.18.0 - sodium: - sha256: b7292dd1da67a049c8e78415cd498ec138d194cfdb302e716b08d26b80fecc10 - version: 1.0.18 - php: - version: 8.1 - repo: magento2-php8-fpm - tags: - - 2.4.4-debian11 + - 2.4.5-debian11 - 2.4-debian11 - 2-debian11 - - 2.4.4 + - 2.4.5 - '2.4' - '2' - latest +