diff options
Diffstat (limited to '.ci/ci.ts')
| -rw-r--r-- | .ci/ci.ts | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/.ci/ci.ts b/.ci/ci.ts new file mode 100644 index 0000000..7908462 --- /dev/null +++ b/.ci/ci.ts @@ -0,0 +1,41 @@ +#!/usr/bin/env node + +import { BuildDockerImageJob, DefaultGitHookPipelineBuilder } from "@emprespresso/ci_model"; + +const REGISTRY = "img.liz.coffee"; +const NAMESPACE = "emprespresso"; +const IMG = "rookery"; + +/** + * 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. + */ +const getPipeline = () => { + const gitHookPipeline = new DefaultGitHookPipelineBuilder(); + const branch = gitHookPipeline.getBranch(); + if (!branch) return gitHookPipeline.build(); + + const build: BuildDockerImageJob = { + type: "build_docker_image.js", + arguments: { + context: gitHookPipeline.getSourceDestination(), + registry: REGISTRY, + namespace: NAMESPACE, + repository: IMG, + imageTag: branch, + commit: gitHookPipeline.getRev(), + buildTarget: IMG, + dockerfile: "Dockerfile", + }, + }; + gitHookPipeline.addStage({ parallelJobs: [build] }); + + return gitHookPipeline.build(); +}; + +const main = () => { + const data = getPipeline().serialize(); + process.stdout.write(data); +}; + +main(); |
