summaryrefslogtreecommitdiff
path: root/module/acme/src/main
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2021-01-12 20:57:56 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2021-01-12 21:35:09 +0100
commit250cb0fb4fa9787c78b73b44425676cfec3a7944 (patch)
tree5a5c15990b15203d8e6386a9ebeb49de2bf0fea5 /module/acme/src/main
parent5f294077a362d0127146882e6c90b863c4f54703 (diff)
downloadrules-sandbox-250cb0fb4fa9787c78b73b44425676cfec3a7944.tar.gz
rules-sandbox-250cb0fb4fa9787c78b73b44425676cfec3a7944.tar.bz2
rules-sandbox-250cb0fb4fa9787c78b73b44425676cfec3a7944.tar.xz
rules-sandbox-250cb0fb4fa9787c78b73b44425676cfec3a7944.zip
Starting on generating ansible files for docker-compose setups.
Diffstat (limited to 'module/acme/src/main')
-rw-r--r--module/acme/src/main/resources/io/trygvis/acme/apps/apps.drl25
1 files changed, 16 insertions, 9 deletions
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
index 95f09c8..e7bdfe3 100644
--- a/module/acme/src/main/resources/io/trygvis/acme/apps/apps.drl
+++ b/module/acme/src/main/resources/io/trygvis/acme/apps/apps.drl
@@ -2,7 +2,8 @@ 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.dba.Container
+import io.trygvis.rules.dns.DnsZone;
dialect "mvel"
@@ -12,22 +13,28 @@ when
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"));
+ insert(new Container(cluster, "pdb", "ops", "postgresql", "11"));
+ insert(new Container(cluster, "n8n", "ops", "n8n", "0.84.1"));
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, "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"));
+ insert(new Container(cluster, "statera", app, "statera", tag));
+ insert(new Container(cluster, "statera-console", app, "statera-console", tag));
+ insert(new Container(cluster, "4tune-web", app, "4tune-web", tag));
+ insert(new Container(cluster, "4tune-api", app, "4tune-api", tag));
+ insert(new Container(cluster, "pdb", db, "postgresql", "13"));
+ insert(new Container(cluster, "mdb", db, "mongodb", "3.2"));
end