Revert "Restore staging payment and package management"
This reverts commit751dee39dc, reversing changes made to43581ac0f7.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { setTimeout as sleep } from "node:timers/promises";
|
||||
import { createRectificationV4CandidateEngine } from "../src/lib/rectification-v4/candidate-engine.ts";
|
||||
import { createRectificationV4SupabaseStore } from "../src/lib/rectification-v4/supabase-store.ts";
|
||||
import { authorRectificationV4Question } from "../src/lib/rectification-v4/question-author.ts";
|
||||
import { createRectificationV4Worker } from "../src/lib/rectification-v4/worker.ts";
|
||||
import { createAdminSupabaseClient } from "../src/lib/supabase/admin-client-core.ts";
|
||||
|
||||
@@ -14,6 +15,7 @@ const worker = createRectificationV4Worker({
|
||||
engine: createRectificationV4CandidateEngine({
|
||||
apiBase: process.env.JYOTISH_API_BASE ?? "http://127.0.0.1:5200",
|
||||
}),
|
||||
questionAuthor: authorRectificationV4Question,
|
||||
});
|
||||
|
||||
do {
|
||||
|
||||
@@ -5,14 +5,8 @@ import { pathToFileURL } from "node:url";
|
||||
const shaPattern = /^[0-9a-f]{40}$/;
|
||||
const digestPattern = /^sha256:[0-9a-f]{64}$/;
|
||||
const expectedKeys = ["git_sha", "api_digest", "web_digest"];
|
||||
const defaultRegistry = "ghcr.io/jesse-ux";
|
||||
const acrRepository = "crpi-d1feco6itet73spp.cn-hongkong.personal.cr.aliyuncs.com/copse/jyotisha";
|
||||
const registryPattern = /^(?:[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?)(?::[1-9][0-9]{0,4})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/;
|
||||
|
||||
export function parseStagingImageManifest(text, expectedSha, registry = defaultRegistry) {
|
||||
if (!registryPattern.test(registry)) {
|
||||
throw new Error("invalid staging image registry");
|
||||
}
|
||||
export function parseStagingImageManifest(text, expectedSha) {
|
||||
if (!shaPattern.test(expectedSha)) {
|
||||
throw new Error("invalid expected staging revision");
|
||||
}
|
||||
@@ -43,13 +37,12 @@ export function parseStagingImageManifest(text, expectedSha, registry = defaultR
|
||||
}
|
||||
}
|
||||
|
||||
const sharedRepository = registry === acrRepository;
|
||||
return {
|
||||
gitSha: expectedSha,
|
||||
apiDigest: values.get("api_digest"),
|
||||
webDigest: values.get("web_digest"),
|
||||
apiImage: `${sharedRepository ? registry : `${registry}/jyotisha-api`}@${values.get("api_digest")}`,
|
||||
webImage: `${sharedRepository ? registry : `${registry}/jyotisha-web`}@${values.get("web_digest")}`,
|
||||
apiImage: `ghcr.io/jesse-ux/jyotisha-api@${values.get("api_digest")}`,
|
||||
webImage: `ghcr.io/jesse-ux/jyotisha-web@${values.get("web_digest")}`,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -59,14 +52,13 @@ const invokedPath = process.argv[1]
|
||||
|
||||
if (invokedPath === import.meta.url) {
|
||||
try {
|
||||
const [manifestPath, expectedSha, registry] = process.argv.slice(2);
|
||||
const [manifestPath, expectedSha] = process.argv.slice(2);
|
||||
if (!manifestPath || !expectedSha) {
|
||||
throw new Error("manifest path and expected revision are required");
|
||||
}
|
||||
const manifest = parseStagingImageManifest(
|
||||
await readFile(manifestPath, "utf8"),
|
||||
expectedSha,
|
||||
registry,
|
||||
);
|
||||
process.stdout.write(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user