Commit 85e7d684 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Détermine les versions disponibles tout seul.

parent 5ee1b2ce
No related merge requests found
Showing with 11 additions and 8 deletions
+11 -8
variables:
PHP_VERSIONS: "7.1 7.3 7.4 8.0"
.job: .job:
image: ${DISTRO}:${CODENAME} image: ${DISTRO}:${CODENAME}
tags: [docker] tags: [docker]
...@@ -10,9 +7,9 @@ variables: ...@@ -10,9 +7,9 @@ variables:
DISTRO: ${CI_JOB_NAME} DISTRO: ${CI_JOB_NAME}
script: script:
- apt-get update -yqq - apt-get update -yqq
- apt-get install -yq php8.0-cli - apt-get install -yq php-cli
- mkdir public - mkdir public
- php ./map-exts.php ${PHP_VERSIONS} > public/${DISTRO}-${CODENAME}.yml - php ./map-exts.php > public/${DISTRO}-${CODENAME}.yml
artifacts: artifacts:
name: php_packages-${DISTRO}-${CODENAME} name: php_packages-${DISTRO}-${CODENAME}
paths: paths:
......
...@@ -2,12 +2,18 @@ ...@@ -2,12 +2,18 @@
<?php <?php
error_reporting(-1); error_reporting(-1);
$argv = $_SERVER['argv']; $versions = [];
array_shift($argv); exec("apt-cache search php-cli | awk '/^php[0-9]\.[0-9]-/{print $1}'", $versions, $error);
if ($error) {
die("code: $error");
}
$versions = array_map(function($v) {
return substr($v, 3, 3);
}, $versions);
echo "php_packages:"; echo "php_packages:";
foreach($argv as $version) { foreach($versions as $version) {
fputs(STDERR, "\nProcessing PHP ${version}\n"); fputs(STDERR, "\nProcessing PHP ${version}\n");
exec("apt-get install -yq php${version}-cli"); exec("apt-get install -yq php${version}-cli");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment