diff options
Diffstat (limited to 'src/main/resources/io')
-rw-r--r-- | src/main/resources/io/trygvis/rules/acme/acme.drl | 30 | ||||
-rw-r--r-- | src/main/resources/io/trygvis/rules/dba/dba.drl | 1 | ||||
-rw-r--r-- | src/main/resources/io/trygvis/rules/machine/machine.drl | 14 |
3 files changed, 45 insertions, 0 deletions
diff --git a/src/main/resources/io/trygvis/rules/acme/acme.drl b/src/main/resources/io/trygvis/rules/acme/acme.drl new file mode 100644 index 0000000..2439ddb --- /dev/null +++ b/src/main/resources/io/trygvis/rules/acme/acme.drl @@ -0,0 +1,30 @@ +package io.trygvis.rules.acme; + +import io.trygvis.rules.dba.Cluster; +import io.trygvis.rules.dba.Container; + +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 diff --git a/src/main/resources/io/trygvis/rules/dba/dba.drl b/src/main/resources/io/trygvis/rules/dba/dba.drl new file mode 100644 index 0000000..7beceef --- /dev/null +++ b/src/main/resources/io/trygvis/rules/dba/dba.drl @@ -0,0 +1 @@ +package io.trygvis.rules.dba; diff --git a/src/main/resources/io/trygvis/rules/machine/machine.drl b/src/main/resources/io/trygvis/rules/machine/machine.drl new file mode 100644 index 0000000..45df925 --- /dev/null +++ b/src/main/resources/io/trygvis/rules/machine/machine.drl @@ -0,0 +1,14 @@ +package io.trygvis.rules.machine; + +import io.trygvis.rules.dba.Cluster; +import io.trygvis.rules.dba.Container; +import io.trygvis.rules.machine.Machine; +import io.trygvis.rules.dns.DnsEntry; + +rule "New machine" +when + $container: Container() +then + insert(DnsEntry.a($container.name + ".machine.acme.org")); + insert(DnsEntry.aaaa($container.name + ".machine.acme.org")); +end |