package io.trygvis.acme.apps import io.trygvis.rules.machine.Machine; import io.trygvis.rules.dba.Cluster; import io.trygvis.rules.dba.Container import io.trygvis.rules.dns.DnsZone; import io.trygvis.rules.machine.Machine import io.trygvis.rules.machine.MachineSpecification 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, "pdb", "ops", "postgresql", "11", null)); insert(new Container(cluster, "n8n", "ops", "n8n", "0.84.1", null)); end rule "MyApp" when $app: AcmeMyApp() then var zone = new DnsZone($app.environment + ".acme.com"); insert(zone) var cluster = new Cluster("acme-myapp-" + $app.environment); insert(cluster); var app = $app.environment + "-app"; var db = $app.environment + "-db"; var tag = $app.dockerTag; insert(new Container(cluster, "statera", app, "statera", tag, new MachineSpecification(200, 1000))); insert(new Container(cluster, "statera-console", app, "statera-console", tag, new MachineSpecification(100, 50))); insert(new Container(cluster, "4tune-web", app, "4tune-web", tag, new MachineSpecification(100, 50))); insert(new Container(cluster, "4tune-api", app, "4tune-api", tag, new MachineSpecification(200, 200))); insert(new Container(cluster, "pdb", db, "postgresql", "13", new MachineSpecification(500, 500))); insert(new Container(cluster, "mdb", db, "mongodb", "3.2", new MachineSpecification(500, 200))); end