diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2026-01-01 18:32:49 -0800 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2026-01-01 18:32:49 -0800 |
| commit | 9af1854a7e35785a8e86426c4fb1edd465f164a3 (patch) | |
| tree | 8a070c6a9498d952c9ef4ba045f2ebfb25f7b335 /.ci/ci.ts | |
| parent | 0248a3899ed910f005dccaeefc1d9dcb893e8154 (diff) | |
| download | mistymountainstherapy-9af1854a7e35785a8e86426c4fb1edd465f164a3.tar.gz mistymountainstherapy-9af1854a7e35785a8e86426c4fb1edd465f164a3.zip | |
Massive refactor courtesy of 5 dollars of AI tokens
Diffstat (limited to '.ci/ci.ts')
| -rw-r--r-- | .ci/ci.ts | 113 |
1 files changed, 56 insertions, 57 deletions
@@ -1,77 +1,76 @@ #!/usr/bin/env node import { - AnsiblePlaybookJob, - BuildDockerImageJob, - DefaultGitHookPipelineBuilder, - NpmPublishJob, - FetchCodeJob, - CoolifyWebhookJob, - Job, -} from "@emprespresso/ci_model"; -import { join } from "path"; + AnsiblePlaybookJob, + BuildDockerImageJob, + DefaultGitHookPipelineBuilder, + NpmPublishJob, + FetchCodeJob, + CoolifyWebhookJob, + Job +} from '@emprespresso/ci_model'; +import { join } from 'path'; -const REGISTRY = "img.liz.coffee"; -const NAMESPACE = "emprespresso"; -const IMG = "mmt"; -const REMOTE = "https://code.liz.coffee"; +const REGISTRY = 'img.liz.coffee'; +const NAMESPACE = 'emprespresso'; +const IMG = 'mmt'; +const REMOTE = 'https://code.liz.coffee'; const getPipeline = () => { - const gitHookPipeline = new DefaultGitHookPipelineBuilder(); - const branch = gitHookPipeline.getBranch(); - if (!branch) return gitHookPipeline.build(); + const gitHookPipeline = new DefaultGitHookPipelineBuilder(); + const branch = gitHookPipeline.getBranch(); + if (!branch) return gitHookPipeline.build(); - const commonBuildArgs = { - context: gitHookPipeline.getSourceDestination(), - registry: REGISTRY, - namespace: NAMESPACE, - imageTag: branch, - }; + const commonBuildArgs = { + context: gitHookPipeline.getSourceDestination(), + registry: REGISTRY, + namespace: NAMESPACE, + imageTag: branch + }; - const mmtPackageBuild: BuildDockerImageJob = { - type: "build_docker_image.js", - arguments: { - ...commonBuildArgs, - repository: IMG, - buildTarget: IMG, - dockerfile: "Dockerfile", - }, - }; - gitHookPipeline.addStage({ - parallelJobs: [mmtPackageBuild], - }); + const mmtPackageBuild: BuildDockerImageJob = { + type: 'build_docker_image.js', + arguments: { + ...commonBuildArgs, + repository: IMG, + buildTarget: IMG, + dockerfile: 'Dockerfile' + } + }; + gitHookPipeline.addStage({ + parallelJobs: [mmtPackageBuild] + }); - const webhookUrl = getReleaseDeployment(branch); - if (webhookUrl === null) { - return gitHookPipeline.build(); - } + const webhookUrl = getReleaseDeployment(branch); + if (webhookUrl === null) { + return gitHookPipeline.build(); + } - const release: CoolifyWebhookJob = { - type: "coolify_webhook.js", - arguments: { - webhookUrl: webhookUrl!!, - }, - }; - gitHookPipeline.addStage({ parallelJobs: [release] }); + const release: CoolifyWebhookJob = { + type: 'coolify_webhook.js', + arguments: { + webhookUrl: webhookUrl!! + } + }; + gitHookPipeline.addStage({ parallelJobs: [release] }); - return gitHookPipeline.build(); + return gitHookPipeline.build(); }; const getReleaseDeployment = (branch: string) => { - switch (branch) { - case "release": - return "https://plane.liz.coffee/api/v1/deploy?uuid=f40gwg0gg4s4c000ws0s08s8&force=false"; - case "main": - return "https://plane.liz.coffee/api/v1/deploy?uuid=gcw80ssgwg80ogs0sc4k0ww0&force=false"; - default: - return null; - } + switch (branch) { + case 'release': + return 'https://plane.liz.coffee/api/v1/deploy?uuid=f40gwg0gg4s4c000ws0s08s8&force=false'; + case 'main': + return 'https://plane.liz.coffee/api/v1/deploy?uuid=gcw80ssgwg80ogs0sc4k0ww0&force=false'; + default: + return null; + } }; const main = () => { - const data = getPipeline().serialize(); - process.stdout.write(data); + const data = getPipeline().serialize(); + process.stdout.write(data); }; main(); - |
