Skip to content

Commit 8f1b64a

Browse files
authored
chore: adds cat-data-service deployment (#753)
1 parent 7d88ce9 commit 8f1b64a

File tree

2 files changed

+84
-1
lines changed

2 files changed

+84
-1
lines changed

src/cat-data-service/Earthfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ build:
3030
# cargo test -p cat-data-service --all-features
3131
# END
3232

33-
publish:
33+
package:
3434
FROM debian:stable-slim
3535

3636
WORKDIR /app
@@ -43,3 +43,10 @@ publish:
4343
ENTRYPOINT ["/app/entry.sh"]
4444
SAVE IMAGE cat-data-service:$tag
4545

46+
docker:
47+
FROM +package
48+
49+
ARG container='cat-data-service'
50+
ARG tag="latest"
51+
52+
SAVE IMAGE ${container}:${tag}

src/cat-data-service/blueprint.cue

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
project: {
2+
name: "cat-data-service"
3+
deployment: {
4+
on: {
5+
tag: {}
6+
merge: {}
7+
}
8+
bundle: {
9+
env: string | *"dev"
10+
modules: main: {
11+
name: "app"
12+
version: "0.11.1"
13+
values: {
14+
deployment: containers: main: {
15+
image: {
16+
name: _ @forge(name="CONTAINER_IMAGE")
17+
tag: _ @forge(name="GIT_HASH_OR_TAG")
18+
}
19+
20+
env: {
21+
"DATABASE_URL": {
22+
secret: {
23+
name: "eventdb"
24+
key: "url"
25+
}
26+
}
27+
}
28+
29+
ports: {
30+
http: port: 3030
31+
}
32+
}
33+
34+
dns: subdomain: "api"
35+
36+
route: rules: [
37+
{
38+
matches: [
39+
{
40+
path: {
41+
type: "PathPrefix"
42+
value: "/"
43+
}
44+
},
45+
]
46+
target: port: 80
47+
},
48+
]
49+
50+
secrets: {
51+
eventdb: {
52+
ref: "db/eventdb"
53+
template: url: "postgres://{{ .username }}:{{ .password }}@{{ .host }}:{{ .port }}/eventdb"
54+
}
55+
}
56+
57+
service: {
58+
ports: http: 80
59+
}
60+
}
61+
}
62+
}
63+
}
64+
65+
release: {
66+
docker: {
67+
on: {
68+
tag: {}
69+
merge: {}
70+
}
71+
config: {
72+
tag: _ @forge(name="GIT_HASH_OR_TAG")
73+
}
74+
}
75+
}
76+
}

0 commit comments

Comments
 (0)