diff options
Diffstat (limited to '.ci')
| -rwxr-xr-x | .ci/ci.cjs | 18 | ||||
| -rw-r--r-- | .ci/ci.ts | 28 |
2 files changed, 43 insertions, 3 deletions
@@ -5019,6 +5019,16 @@ var isPipeline = (t) => (0, import_pengueno3.isObject)(t) && "serialJobs" in t & var REGISTRY = "img.liz.coffee"; var NAMESPACE = "emprespresso"; var IMG = "rookery"; +var getReleaseDeployment = (branch) => { + switch (branch) { + case "release": + return "https://plane.liz.coffee/api/v1/deploy?uuid=vzhqmprh2hqbjjcqrzxwkzww&force=false"; + case "main": + return "https://plane.liz.coffee/api/v1/deploy?uuid=0hgnqywenjjcfltl6hoxmro0&force=false"; + default: + return null; + } +}; var getPipeline = () => { const gitHookPipeline = new DefaultGitHookPipelineBuilder(); const branch = gitHookPipeline.getBranch(); @@ -5038,6 +5048,14 @@ var getPipeline = () => { } }; gitHookPipeline.addStage({ parallelJobs: [build] }); + const webhookUrl = getReleaseDeployment(branch); + if (webhookUrl === null) + return gitHookPipeline.build(); + const deploy = { + type: "coolify_webhook.js", + arguments: { webhookUrl } + }; + gitHookPipeline.addStage({ parallelJobs: [deploy] }); return gitHookPipeline.build(); }; var main = () => { @@ -1,14 +1,27 @@ #!/usr/bin/env node -import { BuildDockerImageJob, DefaultGitHookPipelineBuilder } from "@emprespresso/ci_model"; +import { BuildDockerImageJob, CoolifyWebhookJob, DefaultGitHookPipelineBuilder } from "@emprespresso/ci_model"; const REGISTRY = "img.liz.coffee"; const NAMESPACE = "emprespresso"; const IMG = "rookery"; +/** Coolify deploy hooks: `release` is the public download site, `main` is the beta one. Other branches only build. */ +const getReleaseDeployment = (branch: string) => { + switch (branch) { + case "release": + return "https://plane.liz.coffee/api/v1/deploy?uuid=vzhqmprh2hqbjjcqrzxwkzww&force=false"; + case "main": + return "https://plane.liz.coffee/api/v1/deploy?uuid=0hgnqywenjjcfltl6hoxmro0&force=false"; + default: + return null; + } +}; + /** - * Every push: build the Dockerfile's `rookery` target, which runs the whole test suite - * (`gradlew check`) and packages the desktop app. A failing test fails the image build. + * Every push builds the Dockerfile's `rookery` target: the test suite runs, the apps are built, and the + * result is a small web server with a download page (a failing test fails the image build). Pushes to + * `main` and `release` then tell Coolify to pull the new image. */ const getPipeline = () => { const gitHookPipeline = new DefaultGitHookPipelineBuilder(); @@ -30,6 +43,15 @@ const getPipeline = () => { }; gitHookPipeline.addStage({ parallelJobs: [build] }); + const webhookUrl = getReleaseDeployment(branch); + if (webhookUrl === null) return gitHookPipeline.build(); + + const deploy: CoolifyWebhookJob = { + type: "coolify_webhook.js", + arguments: { webhookUrl }, + }; + gitHookPipeline.addStage({ parallelJobs: [deploy] }); + return gitHookPipeline.build(); }; |
