blob: bfeccffb53b3e5e9da85672b2bc58a9b3a3ac36a [file] [log] [blame]
Serge Bazanski3d116b22021-03-27 15:43:18 +00001local mirko = import "../../kube/mirko.libsonnet";
2
3{
4 local top = self,
5 shipstuck:: {
6 cfg:: {
Serge Bazanski3df9d0c2021-03-29 14:23:37 +00007 image: "registry.k0.hswaw.net/q3k/shipstuck:315532800-0939d664a3eac4c0c67b447265c67bbcda9939d4",
Serge Bazanski3d116b22021-03-27 15:43:18 +00008 domain: error "domain must be set",
9 },
10 component(cfg, env): mirko.Component(env, "shipstuck") {
11 local shipstuck = self,
12 cfg+: {
13 image: cfg.image,
14 container: shipstuck.GoContainer("main", "/personal/q3k/shipstuck") {
15 command+: [
16 "-public_address", "0.0.0.0:8080",
17 ],
18 },
19 ports+: {
20 publicHTTP: {
21 public: {
22 port: 8080,
23 dns: cfg.domain,
24 },
25 },
26 },
27 },
28 },
29 },
30
31 env(name):: mirko.Environment(name) {
32 local env = self,
33 local cfg = self.cfg,
34 cfg+: {
35 shipstuck: top.shipstuck.cfg,
36 },
37 components: {
38 shipstuck: top.shipstuck.component(cfg.shipstuck, env),
39 },
40 },
41
42 prod: top.env("personal-q3k") {
43 cfg+: {
44 shipstuck+: {
45 domain: "shipstuck.q3k.org",
46 },
47 },
48 },
49}