Skip to content

Commit

Permalink
Merge pull request #808 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Prepare release of autoupgrade v6.0.0
  • Loading branch information
Quetzacoalt91 authored Jul 23, 2024
2 parents 4b8213e + 7987640 commit 7c7c84d
Show file tree
Hide file tree
Showing 257 changed files with 91,855 additions and 11,029 deletions.
23 changes: 18 additions & 5 deletions .github/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,21 @@ runs:
env:
VERSION: ${{ matrix.from }}
BASE_VERSION: ${{ steps.get_base_version.outputs.BASE_VERSION }}
PS_INSTALL_AUTO: 0
shell: bash
run: |
docker compose up -d
bash -c 'while [[ "$(curl -L -s -o /dev/null -w %{http_code} http://localhost:8001/index.php)" != "200" ]]; do sleep 5; done'
${{ github.action_path }}check_url.sh http://localhost:8001/index.php 200
docker compose run -u www-data:www-data --rm reference-release php -d memory_limit=-1 /var/www/html/install-dev/index_cli.php \
--domain=localhost:8001 --db_server=mysql:3306 --db_name=psreference --db_user=root \
--db_password=root --prefix=ps_ --firstname="John" --lastname="Doe" \
--password=prestashop_demo --email=demo@prestashop.com --language=en --country=fr \
--all_languages=0 --newsletter=0 --send_email=0 --ssl=0
- name: Copy autoupgrade module
shell: bash
run: docker exec -u www-data prestashop_autoupgrade cp modules/autoupgrade/ -R admin-dev

- name: Upgrade (intermediate)
env:
CHANNEL: 'archive'
Expand All @@ -53,7 +61,8 @@ runs:
[[ "$SKIP" == true ]] || docker stop prestashop_autoupgrade
[[ "$SKIP" == true ]] || docker rm prestashop_autoupgrade
[[ "$SKIP" == true ]] || docker run --name prestashop_autoupgrade -p 8001:80 -v autoupgrade_temp-ps:/var/www/html -v "$(pwd):/var/www/html/modules/autoupgrade" --network autoupgrade_default -d prestashop/base:7.2-apache
[[ "$SKIP" == true ]] || bash -c 'while [[ "$(curl -L -s -o /dev/null -w %{http_code} http://localhost:8001/index.php)" == "000" ]]; do sleep 5; done'
[[ "$SKIP" == true ]] || ${{ github.action_path }}check_url.sh http://localhost:8001/index.php 200
- name: Upgrade
env:
CHANNEL: ${{ matrix.ps-versions.channel }}
Expand All @@ -63,16 +72,20 @@ runs:
FROM: ${{ matrix.from }}
shell: bash
run: ${{ github.action_path }}action_upgrade.sh

- name: Check endpoints response
shell: bash
run: |
bash -c '[ "$(curl -L -s -o /dev/null -w %{http_code} http://localhost:8001/index.php)" == "200" ]'
bash -c '[ "$(curl -L -s -o /dev/null -w %{http_code} http://localhost:8001/admin-dev/index.php)" == "200" ]'
- name: Rollback
shell: bash
run: docker exec -u www-data prestashop_autoupgrade php modules/autoupgrade/tests/testCliProcess.php \
admin-dev/autoupgrade/cli-rollback.php --dir="admin-dev" \
--backup=`docker exec prestashop_autoupgrade bash -c "ls -td -- /var/www/html/admin-dev/autoupgrade/backup/*/ | head -n 1 | cut -d'/' -f8 | tr -d '\n'"`;
run: |
backupName=$(docker exec prestashop_autoupgrade bash -c "ls -td -- /var/www/html/admin-dev/autoupgrade/backup/*/ | head -n 1 | cut -d'/' -f8 | tr -d '\n'")
docker exec -u www-data prestashop_autoupgrade php admin-dev/autoupgrade/cli-rollback.php --dir="admin-dev" \
--backup=$backupName;
- name: Check endpoints response
shell: bash
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/action_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ if [[ $CHANNEL == "archive" ]]; then
docker exec -u www-data prestashop_autoupgrade php admin-dev/autoupgrade/cli-updateconfig.php --from=modules/autoupgrade/config.json --dir=admin-dev
fi

docker exec -u www-data prestashop_autoupgrade php modules/autoupgrade/tests/testCliProcess.php admin-dev/autoupgrade/cli-upgrade.php --dir="admin-dev" --action="compareReleases"
docker exec -u www-data prestashop_autoupgrade php modules/autoupgrade/tests/testCliProcess.php admin-dev/autoupgrade/cli-upgrade.php --dir="admin-dev"
docker exec -u www-data prestashop_autoupgrade php admin-dev/autoupgrade/cli-upgrade.php --dir="admin-dev" --action="compareReleases"
docker exec -u www-data prestashop_autoupgrade php admin-dev/autoupgrade/cli-upgrade.php --dir="admin-dev"
18 changes: 18 additions & 0 deletions .github/check_url.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

if [ -z "$1" ]; then
echo "Usage: $0 <url> [expected_http_code]"
exit 1
fi

URL=$1
HTTP_CODE=${2:-200}
start_time=$(date +%s)

while [[ "$(curl -L -s -o /dev/null -w %{http_code} "$URL")" != "$HTTP_CODE" ]]; do
if [[ $(($(date +%s) - start_time)) -ge 300 ]]; then
echo "Timeout reached"
exit 1
fi
sleep 5
done
39 changes: 0 additions & 39 deletions .github/get_matrix.php

This file was deleted.

249 changes: 0 additions & 249 deletions .github/get_results.php

This file was deleted.

9 changes: 9 additions & 0 deletions .github/mktp-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"id_product" : "5496",
"technical_name" : "autoupgrade",
"display_name" : "1-Click Upgrade - AutoUpgrade",
"channel" : "stable",
"type_upgrade" : "minor",
"product_type" : "module",
"compatible_from": "1.7.0.0"
}
Loading

0 comments on commit 7c7c84d

Please sign in to comment.