Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@
"matchUpdateTypes": ["minor", "patch", "lockFileMaintenance"],
"groupName": "All non-major"
}
],
"customManagers": [
{
"customType": "regex",
"managerFilePatterns": ["/^src/utils\\.ts$/"],
"matchStrings": ["Image: string = \"(?<depName>[^:\"]+):(?<currentValue>[^\"]+)\""],
"datasourceTemplate": "docker"
}
]
}
13 changes: 9 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,9 @@ export class Utils {
}

static readonly gclRegistryPrefix: string = "registry.gcl.local";
static readonly gclRegistryImage: string = "registry:3.1.1";
static readonly gclOpensslImage: string = "alpine/openssl:3.5.7";
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 +449,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 +484,20 @@ 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,
]);

await Utils.spawn([argv.containerExecutable, "pull", this.gclCurlImage]);
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated

try {
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