Rilascio: immagine provata senza rete e scansionata, pulizia a fine lavoro
Il lavoro «immagine» del rilascio costruisce come la verifica, con gli stessi script: prima della pubblicazione il contenitore parte senza rete fino al controllo di salute e Trivy ferma tutto per una CRITICAL con correzione; alla fine, sempre, toglie immagini, contenitori, cache e builder dell'esecuzione, e all'inizio i resti di esecuzioni interrotte. Il resto non cambia: prove, Windows, pubblicazione con il segreto (o la release che dice che manca) e release. Ogni lavoro ha un tempo massimo. La prova del flusso segue la pubblicazione nello script comune. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f35b0a7301
commit
7d8ea22381
2 files changed
+67
-20
No files matched your search
@@ -145,13 +145,25 @@ public sealed partial class PackagingTests
|
||||
StringAssert.Contains(secret, "presente=no");
|
||||
StringAssert.Contains(Step(image, "Pubblicazione sul registro di Gitea"), "if: steps.segreto.outputs.presente == 'si'");
|
||||
|
||||
// The registry at home answers in HTTP: buildx with its own builder, told so, and no «docker login».
|
||||
// The registry at home answers in HTTP: buildx with its own builder, told so, and no «docker login». The push is
|
||||
// the same build as the tested one (.gitea/scripts/costruisci-immagine.sh, shared with the verification).
|
||||
StringAssert.Contains(image, "uses: docker/setup-buildx-action@v3");
|
||||
StringAssert.Contains(image, "http = true");
|
||||
StringAssert.Contains(image, "insecure = true");
|
||||
StringAssert.Contains(image, "--push");
|
||||
Assert.DoesNotContain("docker login", image);
|
||||
Assert.DoesNotContain("docker push", image);
|
||||
StringAssert.Contains(Step(image, "Pubblicazione sul registro di Gitea"), "bash .gitea/scripts/costruisci-immagine.sh pubblica");
|
||||
var build = File.ReadAllText(Repository.PathOf(".gitea", "scripts", "costruisci-immagine.sh"));
|
||||
StringAssert.Contains(build, "docker buildx build \"${comuni[@]}\" \"${etichette[@]}\" --push .");
|
||||
foreach (var text in new[] { image, build })
|
||||
{
|
||||
Assert.DoesNotContain("docker login", text);
|
||||
Assert.DoesNotContain("docker push", text);
|
||||
}
|
||||
|
||||
// Before publishing, the image is started without a network and scanned (Trivy); at the end everything of the
|
||||
// run goes away, whatever happened.
|
||||
StringAssert.Contains(image, "bash .gitea/scripts/prova-immagine.sh");
|
||||
StringAssert.Contains(image, "bash .gitea/scripts/scansione-immagine.sh");
|
||||
StringAssert.Contains(Step(image, "Pulizia (sempre)"), "if: always()");
|
||||
|
||||
// pkg-4: compose.yml goes out with chromium/seccomp.json next to it, never alone.
|
||||
StringAssert.Contains(release, "cp docker/compose.yml \"$COMPOSE/compose.yml\"");
|
||||
|
||||
Reference in new issue
Block a user