diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-07 12:20:02 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2021-01-07 12:20:02 +0100 |
commit | 70d0ad3c9f37e44a9504a0d7f66e412a3f3bba6f (patch) | |
tree | 623815a975541ebba1fba8208bd2b3e984ceb9d4 /module/acme/src/main/resources/io | |
parent | ede2372547db659e7b0e9cfd3b531ff542018229 (diff) | |
download | rules-sandbox-70d0ad3c9f37e44a9504a0d7f66e412a3f3bba6f.tar.gz rules-sandbox-70d0ad3c9f37e44a9504a0d7f66e412a3f3bba6f.tar.bz2 rules-sandbox-70d0ad3c9f37e44a9504a0d7f66e412a3f3bba6f.tar.xz rules-sandbox-70d0ad3c9f37e44a9504a0d7f66e412a3f3bba6f.zip |
More Wireguard.
Fixing broken myapps too.
Diffstat (limited to 'module/acme/src/main/resources/io')
-rw-r--r-- | module/acme/src/main/resources/io/trygvis/acme/acme.drl | 26 | ||||
-rw-r--r-- | module/acme/src/main/resources/io/trygvis/acme/apps/apps.drl | 33 |
2 files changed, 33 insertions, 26 deletions
diff --git a/module/acme/src/main/resources/io/trygvis/acme/acme.drl b/module/acme/src/main/resources/io/trygvis/acme/acme.drl index d978579..66623c3 100644 --- a/module/acme/src/main/resources/io/trygvis/acme/acme.drl +++ b/module/acme/src/main/resources/io/trygvis/acme/acme.drl @@ -11,32 +11,6 @@ declare AcmeServer machine : Machine end -rule "Ops" -when - $ops: AcmeOps() -then - var cluster = new Cluster("acme-ops"); - insert(cluster); - insert(new Container(cluster, "app", "pdb", "postgresql", "11")); - insert(new Container(cluster, "app", "n8n", "n8n", "0.84.1")); -end - -rule "MyApp" -when - $app: AcmeMyApp() -then - var cluster = new Cluster("acme-" + $app.environment); - insert(cluster); - - var tag = $app.dockerTag; - insert(new Container(cluster, "app", "statera", "statera", tag)); - insert(new Container(cluster, "app", "statera-console", "statera-console", tag)); - insert(new Container(cluster, "app", "4tune-web", "4tune-web", tag)); - insert(new Container(cluster, "app", "4tune-api", "4tune-api", tag)); - insert(new Container(cluster, "db", "pdb", "postgresql", "13")); - insert(new Container(cluster, "db", "mdb", "mongodb", "3.2")); -end - rule "Create Acme servers" when $m : Machine(name.startsWith("acme-")) diff --git a/module/acme/src/main/resources/io/trygvis/acme/apps/apps.drl b/module/acme/src/main/resources/io/trygvis/acme/apps/apps.drl new file mode 100644 index 0000000..95f09c8 --- /dev/null +++ b/module/acme/src/main/resources/io/trygvis/acme/apps/apps.drl @@ -0,0 +1,33 @@ +package io.trygvis.acme.apps; + +import io.trygvis.rules.machine.Machine; +import io.trygvis.rules.dba.Cluster; +import io.trygvis.rules.dba.Container; + +dialect "mvel" + +rule "Ops" +when + $ops: AcmeOps() +then + var cluster = new Cluster("acme-ops"); + insert(cluster); + insert(new Container(cluster, "app", "pdb", "postgresql", "11")); + insert(new Container(cluster, "app", "n8n", "n8n", "0.84.1")); +end + +rule "MyApp" +when + $app: AcmeMyApp() +then + var cluster = new Cluster("acme-myapp-" + $app.environment); + insert(cluster); + + var tag = $app.dockerTag; + insert(new Container(cluster, "app", "statera", "statera", tag)); + insert(new Container(cluster, "app", "statera-console", "statera-console", tag)); + insert(new Container(cluster, "app", "4tune-web", "4tune-web", tag)); + insert(new Container(cluster, "app", "4tune-api", "4tune-api", tag)); + insert(new Container(cluster, "db", "pdb", "postgresql", "13")); + insert(new Container(cluster, "db", "mdb", "mongodb", "3.2")); +end |