Skip to content
Extraits de code Groupes Projets
Valider 2692e883 rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Refs #6930, allow plugins to test against minimum required Piwik version in travis build.

parent 6799beac
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -90,17 +90,7 @@ install: ...@@ -90,17 +90,7 @@ install:
- git clone -q https://github.com/piwik/piwik.git piwik - git clone -q https://github.com/piwik/piwik.git piwik
- cd piwik - cd piwik
- git fetch -q --all - git fetch -q --all
- | - ./tests/travis/checkout_test_against_branch.sh
if [ "$TEST_AGAINST_PIWIK_BRANCH" == "" ]; then
if [ "$TEST_AGAINST_CORE" == "latest_stable" ]; then
export TEST_AGAINST_PIWIK_BRANCH=$(git describe --tags `git rev-list --tags --max-count=1`)
export TEST_AGAINST_PIWIK_BRANCH=`echo $TEST_AGAINST_PIWIK_BRANCH | tr -d ' ' | tr -d '\n'`
else
export TEST_AGAINST_PIWIK_BRANCH=master
fi
fi
- echo "Testing against '$TEST_AGAINST_PIWIK_BRANCH'"
- git checkout "$TEST_AGAINST_PIWIK_BRANCH" -q
- git submodule init -q - git submodule init -q
- git submodule update -q || true - git submodule update -q || true
{% else %} {% else %}
......
#!/bin/bash
SCRIPT_DIR=`dirname $0`
if [ "$TEST_AGAINST_PIWIK_BRANCH" == "" ]; then
if [ "$TEST_AGAINST_CORE" == "latest_stable" ]; then # test against the latest stable release of piwik core (including betas & release candidates)
export TEST_AGAINST_PIWIK_BRANCH=$(git describe --tags `git rev-list --tags --max-count=1`)
export TEST_AGAINST_PIWIK_BRANCH=`echo $TEST_AGAINST_PIWIK_BRANCH | tr -d ' ' | tr -d '\n'`
elif [[ "$TEST_AGAINST_CORE" == "minimum_required_piwik" && "$PLUGIN_NAME" != "" ]]; then # test against the minimum required Piwik in the plugin.json file
export TEST_AGAINST_PIWIK_BRANCH=$(php "$SCRIPT_DIR/get_required_piwik_version.php" $PLUGIN_NAME)
else
export TEST_AGAINST_PIWIK_BRANCH=master
fi
fi
echo "Testing against '$TEST_AGAINST_PIWIK_BRANCH'"
git checkout "$TEST_AGAINST_PIWIK_BRANCH" -q
<?php
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
// tiny script to get plugin version from plugin.json from a bash script
$pluginName = $argv[1];
$pluginJsonPath = __DIR__ . "/../../plugins/$pluginName/plugin.json";
$pluginJsonContents = file_get_contents($pluginJsonPath);
$pluginJsonContents = json_decode($pluginJsonContents, true);
$minimumRequiredPiwik = @$pluginJsonContents["require"]["piwik"];
if (empty($minimumRequiredPiwik)) {
$minimumRequiredPiwik = "master";
} else {
if (!preg_match("/^[^0-9]*(.*)/", $minimumRequiredPiwik, $matches)
|| empty($matches[1])
) {
$minimumRequiredPiwik = "master";
} else {
$minimumRequiredPiwik = $matches[1];
}
}
echo $minimumRequiredPiwik;
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter