t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/GCP/Run/fixtures/job.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

28 lines
767 B
TypeScript

import * as GCP from "@/GCP";
import * as Effect from "effect/Effect";
export const MARKER_OBJECT = "marker.txt";
/**
* Effect-native Cloud Run Job whose `run` entry writes a Storage object.
* Deployed from {@link ../Job.test.ts}.
*/
export default class MarkerJob extends GCP.Run.Job<MarkerJob>()(
"MarkerJob",
{
main: import.meta.url,
location: "us-central1",
},
Effect.gen(function* () {
const bucket = yield* GCP.Storage.Bucket("JobRunMarker", {
forceDestroy: true,
});
const putObject = yield* GCP.Storage.PutObject(bucket);
return {
run: putObject({ name: MARKER_OBJECT, body: "ran" }).pipe(
Effect.asVoid,
Effect.orDie,
),
};
}).pipe(Effect.provide(GCP.Storage.PutObjectHttp)),
) {}