diff --git a/src/cat-data-service/Earthfile b/src/cat-data-service/Earthfile index abd0906752..4f748343b4 100644 --- a/src/cat-data-service/Earthfile +++ b/src/cat-data-service/Earthfile @@ -30,7 +30,7 @@ build: # cargo test -p cat-data-service --all-features # END -publish: +package: FROM debian:stable-slim WORKDIR /app @@ -43,3 +43,10 @@ publish: ENTRYPOINT ["/app/entry.sh"] SAVE IMAGE cat-data-service:$tag +docker: + FROM +package + + ARG container='cat-data-service' + ARG tag="latest" + + SAVE IMAGE ${container}:${tag} \ No newline at end of file diff --git a/src/cat-data-service/blueprint.cue b/src/cat-data-service/blueprint.cue new file mode 100644 index 0000000000..2c17f36e9b --- /dev/null +++ b/src/cat-data-service/blueprint.cue @@ -0,0 +1,76 @@ +project: { + name: "cat-data-service" + deployment: { + on: { + tag: {} + merge: {} + } + bundle: { + env: string | *"dev" + modules: main: { + name: "app" + version: "0.11.1" + values: { + deployment: containers: main: { + image: { + name: _ @forge(name="CONTAINER_IMAGE") + tag: _ @forge(name="GIT_HASH_OR_TAG") + } + + env: { + "DATABASE_URL": { + secret: { + name: "eventdb" + key: "url" + } + } + } + + ports: { + http: port: 3030 + } + } + + dns: subdomain: "api" + + route: rules: [ + { + matches: [ + { + path: { + type: "PathPrefix" + value: "/" + } + }, + ] + target: port: 80 + }, + ] + + secrets: { + eventdb: { + ref: "db/eventdb" + template: url: "postgres://{{ .username }}:{{ .password }}@{{ .host }}:{{ .port }}/eventdb" + } + } + + service: { + ports: http: 80 + } + } + } + } + } + + release: { + docker: { + on: { + tag: {} + merge: {} + } + config: { + tag: _ @forge(name="GIT_HASH_OR_TAG") + } + } + } +}