Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@
"matchUpdateTypes": ["minor", "patch", "lockFileMaintenance"],
"groupName": "All non-major"
}
],
"customManagers": [
{
"customType": "regex",
"managerFilePatterns": ["/^src/utils\\.ts$/"],
"matchStrings": ["// renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)\\s+static readonly \\w+: string = \"[^:\"]+:(?<currentValue>[^\"]+)\";"]
}
]
}
15 changes: 11 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,12 @@ export class Utils {
}

static readonly gclRegistryPrefix: string = "registry.gcl.local";
// renovate: datasource=docker depName=registry
static readonly gclRegistryImage: string = "registry:3.1.1";
// renovate: datasource=docker depName=alpine/openssl
static readonly gclOpensslImage: string = "alpine/openssl:3.5.7";
// renovate: datasource=docker depName=curlimages/curl
static readonly gclCurlImage: string = "curlimages/curl:8.21.0";
static async startDockerRegistry (argv: Argv): Promise<void> {
const gclRegistryCertVol = `${this.gclRegistryPrefix}.certs`;
const gclRegistryDataVol = `${this.gclRegistryPrefix}.data`;
Expand All @@ -446,7 +452,7 @@ export class Utils {
"-addext", `subjectAltName=DNS:${this.gclRegistryPrefix}`,
];
const generateCertsInPlace = [
argv.containerExecutable, "run", "--rm", "-v", `${gclRegistryCertVol}:/certs`, "--entrypoint", "sh", "alpine/openssl", "-c",
argv.containerExecutable, "run", "--rm", "-v", `${gclRegistryCertVol}:/certs`, "--entrypoint", "sh", this.gclOpensslImage, "-c",
[
"openssl", ...opensslArgs,
"&&", "mkdir", "-p", `/certs/${this.gclRegistryPrefix}`,
Expand Down Expand Up @@ -481,18 +487,19 @@ export class Utils {
"-e", "REGISTRY_HTTP_ADDR=0.0.0.0:443",
"-e", `REGISTRY_HTTP_TLS_CERTIFICATE=/certs/${this.gclRegistryPrefix}.crt`,
"-e", `REGISTRY_HTTP_TLS_KEY=/certs/${this.gclRegistryPrefix}.key`,
"registry",
this.gclRegistryImage,
]);

try {
await Utils.spawn([argv.containerExecutable, "pull", this.gclCurlImage]);
await execa(argv.containerExecutable, [
"run", "--rm",
"--network", gclRegistryNet,
"--entrypoint", "sh",
"curlimages/curl",
this.gclCurlImage,
"-c", `until [ "$(curl -s -o /dev/null -k -w "%{http_code}" https://${this.gclRegistryPrefix}:443)" = "200" ]; do sleep 1; done;`,
], {
timeout: 4000,
timeout: 10000,
});
} catch (err) {
await this.stopDockerRegistry(argv.containerExecutable);
Expand Down