Skip to content

Commit

Permalink
Merge pull request #883 from mollie/develop
Browse files Browse the repository at this point in the history
Develop-6.0.5
  • Loading branch information
JevgenijVisockij authored Feb 20, 2024
2 parents b3fb716 + 89f0450 commit e52bede
Show file tree
Hide file tree
Showing 668 changed files with 15,183 additions and 27,449 deletions.
32 changes: 0 additions & 32 deletions .docker/.htaccess1785
Original file line number Diff line number Diff line change
Expand Up @@ -36,38 +36,6 @@ RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]


#Domain: demoshop1785.ngrok.io
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api(?:/(.*))?$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^SHOP2$ /SHOP2/ [L,R]
RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^SHOP2/(.*) /$1 [L]

# Images
RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^demoshop1785.ngrok.io$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
Expand Down
80 changes: 0 additions & 80 deletions .docker/.htaccess8

This file was deleted.

6 changes: 5 additions & 1 deletion .docker/Dockerfile.8
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM prestashop/prestashop:8.0.5-apache
FROM prestashop/prestashop:8.1.3-apache

RUN cd /usr/local/etc/php/conf.d/ && \
echo 'memory_limit = 4096M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini

RUN echo 'max_execution_time = 120' >> /usr/local/etc/php/conf.d/docker-php-maxexectime.ini

HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost/ || exit 1


53 changes: 53 additions & 0 deletions .docker/wait-loader.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

spinner() {
local pid=$1
local delay=0.1
local spinstr='|/-\'
while ps a | awk '{print $1}' | grep -q $pid; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
local spinstr=$temp${spinstr%"$temp"}
sleep $delay
printf "\b\b\b\b\b\b"
done
printf " \b\b\b\b"
}

# Function to display loader with a message
show_loader() {
local message=$1
local port=$2
shift 2
echo -n "$message"
( "$@" ) &
local loader_pid=$!
local success=false
while ps a | awk '{print $1}' | grep -q $loader_pid; do
sleep 0.5
echo -n ""

# Check if Docker container host returns a 302 (replace with your actual check)
http_status=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:$port")
if [ "$http_status" -eq 302 ]; then
success=true
break
fi
done

if [ "$success" = true ]; then
echo " Done."
else
echo " Failed: Docker container host did not return a 302."
# Optionally, you can add cleanup or error handling code here.
fi
}

# Usage example with port as a parameter
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <port>"
exit 1
fi

port=$1
show_loader "Building app containers. Please wait " "$port" sleep 120
21 changes: 17 additions & 4 deletions .github/workflows/E2E_On_PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,24 @@ jobs:
matrix:
include:
- prestashop: 'PS1785'
make: 'make e2eh1785'
make: 'make VERSION=1785 e2eh1785'
subdomain: 'demoshop1785'
port: '8002'
yml: 'docker-compose.1785.yml'
url: 'https://demoshop1785.ngrok.io'
test_spec: '**/cypress/e2e/ps1785/**'
TestRailID: R4954
- prestashop: 'PS8'
make: 'make e2eh8'
make: 'make VERSION=8 e2eh8'
subdomain: 'demoshop8'
port: '8142'
port: '8002'
yml: 'docker-compose.8.yml'
url: 'https://demoshop8.ngrok.io'
test_spec: '**/cypress/e2e/ps8/**'
TestRailID: R6470
env:
NGROK_TOKEN: ${{ secrets.NGROK_TOKEN }}
DB_PASSWD: ${{ secrets.DB_PASSWD }}
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -60,8 +61,18 @@ jobs:
- name: Waiting for Ngrok tunnel
run: |
URL="${{ matrix.url }}"
TIMEOUT=120
start_time=$(date +%s)
while true; do
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ "$elapsed_time" -ge "$TIMEOUT" ]; then
echo "Timeout reached. Ngrok tunnel is not ready within $TIMEOUT seconds."
exit 1
fi
response=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
if [ "$response" = "302" ]; then
echo "URL is returning 302 HTTP status code, Ngrok tunnel is reached, good to go!"
Expand All @@ -73,6 +84,7 @@ jobs:
fi
done
- name: Running ${{ matrix.prestashop }} Cypress E2E tests
run: |
export CYPRESS_baseUrl='${{ matrix.url }}'
Expand All @@ -82,9 +94,10 @@ jobs:
export CYPRESS_TESTRAIL_DOMAIN='${{ secrets.TESTRAIL_DOMAIN }}'
export CYPRESS_TESTRAIL_USERNAME='${{ secrets.TESTRAIL_USERNAME }}'
export CYPRESS_TESTRAIL_PASSWORD='${{ secrets.TESTRAIL_PASSWORD }}'
npx cypress cache prune
npm install -D cypress
npm ci
npx cypress run --spec "${{ matrix.test_spec }}" --browser chrome
npx cypress run --spec "${{ matrix.test_spec }}"
- name: Archive videos and screenshots
if: ${{ always() }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upgrading_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
matrix:
include:
- prestashop: 'PS1785'
make: 'make e2eh1785'
make: 'make VERSION=1785 e2eh1785'
port: '8002'
yml: 'docker-compose.1785.yml'
ModuleUpgradeTest: 'make upgrading-module-test-1785'
ModuleUpgradeTest: 'make VERSION=1785 upgrading-module-test-1785'
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down
15 changes: 15 additions & 0 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
<Files ~ "(?i)^.*\.(jpg|jpeg|gif|png|bmp|tiff|svg|pdf|mov|mpeg|mp4|avi|mpg|wma|flv|webm|ico|webp|woff|woff2|ttf|eot|otf|css|js)$">
Allow from all
</Files>
</IfModule>
# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
<Files ~ "(?i)^.*\.(jpg|jpeg|gif|png|bmp|tiff|svg|pdf|mov|mpeg|mp4|avi|mpg|wma|flv|webm|ico|webp|woff|woff2|ttf|eot|otf|css|js)$">
Require all granted
</Files>
</IfModule>
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012-2020, Mollie B.V. All rights reserved.
Copyright (c) 2012-2023, Mollie B.V. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
Expand All @@ -17,4 +17,4 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
DAMAGE.
Loading

0 comments on commit e52bede

Please sign in to comment.