first commit

This commit is contained in:
2024-10-28 22:14:22 +01:00
commit b65352c452
40581 changed files with 5712079 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
drwxr-xr-x 2 30094 users 6 Oct 6 10:16 .
drwxr-xr-x 5 30094 users 10 Oct 6 10:16 ..
-rw-r--r-- 1 30094 users 249 Oct 3 06:58 copy_reports.sh
-rw-r--r-- 1 30094 users 181 Oct 3 06:58 docker_build.sh
-rw-r--r-- 1 30094 users 306 Oct 3 06:58 download_nightly_archive.sh
-rw-r--r-- 1 30094 users 1434 Oct 3 06:58 getTargetVersions.js

View File

@@ -0,0 +1,9 @@
#!/bin/bash
REPORTS_PATH=$1
PS_START_VERSION=$2
PS_TARGET_VERSION=$3
MODULE_BRANCH=$4
mkdir -p $REPORTS_PATH
cp ./tests/e2e/mochawesome-report/mochawesome.json $REPORTS_PATH/$MODULE_BRANCH-upgrade-from-$PS_START_VERSION-to-$PS_TARGET_VERSION.json

View File

@@ -0,0 +1,4 @@
#!/bin/bash
docker-compose -f docker-compose.yml up -d
bash -c 'while [[ "$(curl -L -s -o /dev/null -w %{http_code} http://localhost:8001/index.php)" != "200" ]]; do sleep 5; done'

View File

@@ -0,0 +1,8 @@
#!/bin/bash
ARCHIVE_URL=$1
FILENAME=$2
docker exec -u www-data prestashop_autoupgrade mkdir -p admin-dev/autoupgrade/download
docker exec -u www-data prestashop_autoupgrade curl $ARCHIVE_URL -o admin-dev/autoupgrade/download/$FILENAME
docker exec -u root prestashop_autoupgrade chmod 777 -R /var/www/html

View File

@@ -0,0 +1,62 @@
const axios = require('axios');
const apiUrl = process.env.API_URL || 'https://api-nightly.prestashop.com/reports';
/**
* Get reports from nightly api
* @returns {Promise<*>}
*/
function getReports() {
return axios.get(apiUrl);
}
/**
* Get today reports from nightly api
* @returns {Promise<[]>}
*/
async function getTodayReports() {
// Get today date
const today = new Date().toJSON().slice(0, 10);
// Get reports
const reportsData = (await getReports()).data;
return reportsData.filter(report => report.date === today && report.download !== null);
}
/**
* Get version from a filename
* @param filename
* @returns {string}
*/
function getVersionFormFilename(filename) {
return (filename.match('prestashop_(.*).zip'))[1];
}
/**
* Get output part of the matrix
* @returns {Promise<[]>}
*/
async function getTargetVersions() {
const todayReports = await getTodayReports();
const targetVersions = [];
for (let i = 0; i < todayReports.length; i++) {
const downloadReportUrl = todayReports[i].download;
const row = {
for_test: getVersionFormFilename(downloadReportUrl),
filename: downloadReportUrl.substr(downloadReportUrl.lastIndexOf('/') + 1),
archive_zip: downloadReportUrl,
branch: todayReports[i].version,
};
await targetVersions.push(row);
}
return targetVersions;
}
getTargetVersions()
.then(result => console.log(JSON.stringify(result)));