feat(catalog) : sync Lunaris updates from Discord
This commit is contained in:
@@ -62,6 +62,7 @@ describe("production deployment contract", () => {
|
||||
"k8s/base/configmap.yaml",
|
||||
"k8s/base/deployment.yaml",
|
||||
"k8s/base/worker-deployment.yaml",
|
||||
"k8s/base/discord-worker-deployment.yaml",
|
||||
"k8s/base/service.yaml",
|
||||
"k8s/base/ingress.yaml",
|
||||
"k8s/base/hpa.yaml",
|
||||
@@ -88,6 +89,8 @@ describe("production deployment contract", () => {
|
||||
expect(dockerfile.match(/^USER 1000:1000$/gmu)).toHaveLength(2);
|
||||
expect(dockerfile).toContain('ENTRYPOINT ["bun", "scripts/migrate.ts"]');
|
||||
expect(dockerfile).toContain('CMD ["bun", "server.js"]');
|
||||
expect(dockerfile).toContain("backend/discord.ts");
|
||||
expect(dockerfile).toContain("./worker/discord.js");
|
||||
});
|
||||
|
||||
it("verifies first, publishes immutable images, and migrates before rollout", async () => {
|
||||
@@ -106,6 +109,7 @@ describe("production deployment contract", () => {
|
||||
"registry.neko-piranha.ts.net/astral/buzz-sheet",
|
||||
);
|
||||
expect(workflow).toContain("migrate-${{ gitea.sha }}");
|
||||
expect(workflow).toContain("deployment/buzz-sheet-discord-worker");
|
||||
const deleteMigrationJob = workflow.indexOf(
|
||||
'delete job buzz-sheet-migrate --ignore-not-found',
|
||||
);
|
||||
@@ -150,6 +154,8 @@ describe("environment template contract", () => {
|
||||
"S3_SECRET_ACCESS_KEY",
|
||||
"NEXT_SERVER_ACTIONS_ENCRYPTION_KEY",
|
||||
"NEXT_DEPLOYMENT_ID",
|
||||
"DISCORD_BOT_TOKEN",
|
||||
"DISCORD_CHANNEL_ID",
|
||||
];
|
||||
|
||||
for (const key of requiredKeys) {
|
||||
@@ -157,4 +163,19 @@ describe("environment template contract", () => {
|
||||
}
|
||||
expect(environmentExample).toContain("BUZZ_DEMO_MODE=false");
|
||||
});
|
||||
|
||||
it("runs Discord catalog sync as an isolated worker", async () => {
|
||||
const [deployment, rbac] = await Promise.all([
|
||||
repositoryFile("k8s/base/discord-worker-deployment.yaml"),
|
||||
repositoryFile("k8s/base/ci-rbac.yaml"),
|
||||
]);
|
||||
|
||||
expect(deployment).toContain("name: buzz-sheet-discord-worker");
|
||||
expect(deployment).toContain("type: Recreate");
|
||||
expect(deployment).toContain('command: ["bun", "worker/discord.js"]');
|
||||
expect(deployment).toContain("replicas: 1");
|
||||
expect(deployment).toContain("readOnlyRootFilesystem: true");
|
||||
expect(deployment).toContain('drop: ["ALL"]');
|
||||
expect(rbac).toContain("buzz-sheet-discord-worker");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user