Exclude windowsservercore and nanoserver cleanly.

This commit is contained in:
Greyscale 2019-08-13 18:31:15 +02:00
parent 0bd37fa4ae
commit eecccd3833
2 changed files with 9 additions and 10 deletions

View file

@ -11,12 +11,8 @@ script:
- 'docker-compose -f build.yml build redis-$VERSION' - 'docker-compose -f build.yml build redis-$VERSION'
after_script: after_script:
- 'docker-compose -f build.yml push redis-$VERSION' - 'docker-compose -f build.yml push redis-$VERSION'
matrix:
allow_failures: { env: [VERSION=windowsservercode, VERSION=nanoserver] }
env: env:
- VERSION=windowsservercore
- VERSION=stretch - VERSION=stretch
- VERSION=nanoserver
- VERSION=latest - VERSION=latest
- VERSION=buster - VERSION=buster
- VERSION=alpine3.9 - VERSION=alpine3.9
@ -214,3 +210,5 @@ env:
- VERSION=3.2.5-alpine - VERSION=3.2.5-alpine
- VERSION=3.2.5-32bit - VERSION=3.2.5-32bit
- VERSION=3.2.5 - VERSION=3.2.5
- VERSION=3.2.4-alpine
- VERSION=3.2.4-32bit

View file

@ -4,11 +4,14 @@ require_once __DIR__ . "/vendor/autoload.php";
use \Symfony\Component\Yaml\Yaml; use \Symfony\Component\Yaml\Yaml;
$image = "library/redis";
$excludedTags = ['windowsservercore', 'nanoserver'];
$client = new \GuzzleHttp\Client(); $client = new \GuzzleHttp\Client();
$allLoaded = false; $allLoaded = false;
$results = []; $results = [];
$url = "https://hub.docker.com/v2/repositories/library/redis/tags/"; $url = "https://hub.docker.com/v2/repositories/{$image}/tags/";
while($allLoaded == false) { while($allLoaded == false) {
$data = $client->get($url)->getBody()->getContents(); $data = $client->get($url)->getBody()->getContents();
$json = json_decode($data, true); $json = json_decode($data, true);
@ -41,11 +44,6 @@ $travisYaml = [
'after_script' => [ 'after_script' => [
'docker-compose -f build.yml push redis-$VERSION' 'docker-compose -f build.yml push redis-$VERSION'
], ],
'matrix' => [
'allow_failures' => [
'env' => [ 'VERSION=windowsservercode', 'VERSION=nanoserver' ],
],
],
'env' => [], 'env' => [],
]; ];
@ -55,6 +53,9 @@ $buildYaml = [
]; ];
foreach($results as $result) { foreach($results as $result) {
if(in_array($result['name'], $excludedTags))
continue;
$dockerfileLines = []; $dockerfileLines = [];
$dockerfileLines[] = "# From upstream {$result['name']}"; $dockerfileLines[] = "# From upstream {$result['name']}";
$dockerfileLines[] = "FROM redis:{$result['name']}"; $dockerfileLines[] = "FROM redis:{$result['name']}";