@@ -4,6 +4,7 @@ local postgres = require('compose/postgres')
4
4
local pgadmin = require ('compose/pgadmin' )
5
5
local keycloak = require ('compose/keycloak' )
6
6
local kcadm = require ('compose/kcadm' )
7
+ local app = require ('compose/app' )
7
8
8
9
local datasource_keycloak = {
9
10
uri = 'jdbc:postgresql://env_postgres:5432/keycloak' ,
@@ -18,7 +19,7 @@ local datasource_app = {
18
19
}
19
20
20
21
ggcode .generate "@/compose" {
21
- target = '@examples ' ,
22
+ target = '@app ' ,
22
23
variables = {
23
24
config = {
24
25
include = {
@@ -30,13 +31,14 @@ ggcode.generate "@/compose" {
30
31
{ path = "compose/env/env_swagger_ui.compose.yaml" },
31
32
{ path = "compose/env/env_keycloak.compose.yaml" },
32
33
{ path = "compose/env/env_kcadm.compose.yaml" },
34
+ { path = "compose/app/app_assembly_web.compose.yaml" },
33
35
}
34
36
}
35
37
}
36
38
}
37
39
38
40
ggcode .generate "@/haproxy" {
39
- target = '@examples ' ,
41
+ target = '@app ' ,
40
42
variables = haproxy .build {
41
43
haproxy .Route :from_arrow ('http://kafka-ui.local.example.com' , 'http://env_kafka_ui:8080' );
42
44
haproxy .Route :from_arrow ('http://pgadmin.local.example.com' , 'http://env_pgadmin:80' );
@@ -46,53 +48,56 @@ ggcode.generate "@/haproxy" {
46
48
haproxy .Route :from_uri_string ('http://api.local.example.com' )
47
49
:with_name ('api' )
48
50
:with_proxies ({
51
+ haproxy .Proxy :from_path_string ('/api/assembly_web' )
52
+ :with_cors ('*' )
53
+ :with_server (haproxy .Server :from_uri_string ('http://app_assembly_web:8080' ):with_optional (true ));
49
54
haproxy .Proxy :from_path_string ('/api/service_catalog' )
50
55
:with_cors ('*' )
51
- :with_server (haproxy .Server :from_uri_string ('http://host.docker.internal:8080 ' ):with_optional (true ));
56
+ :with_server (haproxy .Server :from_uri_string ('http://host.docker.internal:8081 ' ):with_optional (true ));
52
57
haproxy .Proxy :from_path_string ('/api/service_customers' )
53
58
:with_cors ('*' )
54
- :with_server (haproxy .Server :from_uri_string ('http://host.docker.internal:8081 ' ):with_optional (true ));
59
+ :with_server (haproxy .Server :from_uri_string ('http://host.docker.internal:8082 ' ):with_optional (true ));
55
60
haproxy .Proxy :from_path_string ('/api/service_basket' )
56
61
:with_cors ('*' )
57
- :with_server (haproxy .Server :from_uri_string ('http://host.docker.internal:8082 ' ):with_optional (true ));
62
+ :with_server (haproxy .Server :from_uri_string ('http://host.docker.internal:8083 ' ):with_optional (true ));
58
63
haproxy .Proxy :from_path_string ('/api/service_payments' )
59
64
:with_cors ('*' )
60
- :with_server (haproxy .Server :from_uri_string ('http://host.docker.internal:8083 ' ):with_optional (true ));
65
+ :with_server (haproxy .Server :from_uri_string ('http://host.docker.internal:8084 ' ):with_optional (true ));
61
66
haproxy .Proxy :from_path_string ('/api/service_events' )
62
67
:with_cors ('*' )
63
- :with_server (haproxy .Server :from_uri_string ('http://host.docker.internal:8084 ' ):with_optional (true ));
68
+ :with_server (haproxy .Server :from_uri_string ('http://host.docker.internal:8085 ' ):with_optional (true ));
64
69
});
65
70
}
66
71
}
67
72
68
- ggcode .generate "@/kafka" { target = '@examples ' }
69
- ggcode .generate "@/kafka_ui" { target = '@examples ' }
73
+ ggcode .generate "@/kafka" { target = '@app ' }
74
+ ggcode .generate "@/kafka_ui" { target = '@app ' }
70
75
71
76
ggcode .generate "@/pgadmin" {
72
- target = '@examples ' ,
77
+ target = '@app ' ,
73
78
variables = pgadmin .build {
74
79
pgadmin .Server :from_datasource (datasource_keycloak ),
75
80
pgadmin .Server :from_datasource (datasource_app ),
76
81
}
77
82
}
78
83
79
84
ggcode .generate "@/postgres" {
80
- target = '@examples ' ,
85
+ target = '@app ' ,
81
86
variables = postgres .build {
82
87
postgres .Database :from_datasource (datasource_keycloak ),
83
88
postgres .Database :from_datasource (datasource_app ),
84
89
}
85
90
}
86
91
87
92
ggcode .generate "@/keycloak" {
88
- target = '@examples ' ,
93
+ target = '@app ' ,
89
94
variables = keycloak .build {
90
95
keycloak .Manifest :new ():with_datasource (datasource_keycloak ),
91
96
}
92
97
}
93
98
94
99
ggcode .generate "@/kcadm" {
95
- target = '@examples ' ,
100
+ target = '@app ' ,
96
101
variables = kcadm .build {
97
102
kcadm .Realm :from ('application' ),
98
103
@@ -121,10 +126,11 @@ ggcode.generate "@/kcadm" {
121
126
}
122
127
123
128
ggcode .generate "@/swagger_ui" {
124
- target = '@examples ' ,
129
+ target = '@app ' ,
125
130
variables = {
126
131
config = {
127
132
urls = {
133
+ { name = "Assembly Web" , url = "http://api.local.example.com/api/assembly_web/v3/api-docs" },
128
134
{ name = "Service Catalogue" , url = "http://api.local.example.com/api/service_catalog/v3/api-docs" },
129
135
{ name = "Service Customers" , url = "http://api.local.example.com/api/service_customers/v3/api-docs" },
130
136
{ name = "Service Basket" , url = "http://api.local.example.com/api/service_basket/v3/api-docs" },
@@ -134,3 +140,19 @@ ggcode.generate "@/swagger_ui" {
134
140
}
135
141
}
136
142
}
143
+
144
+ local service_assembly_web =
145
+
146
+ ggcode .generate "@/app" {
147
+ target = '@app' ,
148
+ variables = app .Service
149
+ :from ('app_assembly_web' , 'example/assembly_web:1.0-SNAPSHOT' )
150
+ :with_depends_on ('env_kafka' )
151
+ :with_depends_on ('env_postgres' )
152
+ :with_depends_on ('env_keycloak' )
153
+ :with_spring_datasource (datasource_app )
154
+ :with_env_variable ('SPRING_KAFKA_BOOTSTRAP_SERVERS' , 'env_kafka:29092' )
155
+ :with_link ('env_haproxy:auth.local.example.com' )
156
+ -- :with_env_variable('SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUERURI', 'http://env_keycloak:8080/auth/realms/application')
157
+ :unwrap ()
158
+ }
0 commit comments