@@ -11,6 +11,10 @@ plugins {
11
11
id(" org.jetbrains.kotlinx.kover" )
12
12
}
13
13
14
+ val testNgVersion = " 7.8.0"
15
+ val testContainersRedisVersion = " 1.6.4"
16
+ val testContainersPostgreSQLVersion = " 1.19.7"
17
+
14
18
dependencies {
15
19
implementation(projects.cosmotechMetaApi)
16
20
implementation(projects.cosmotechConnectorApi)
@@ -21,11 +25,6 @@ dependencies {
21
25
implementation(projects.cosmotechMetricsService)
22
26
implementation(projects.cosmotechRunApi)
23
27
implementation(projects.cosmotechRunnerApi)
24
-
25
- testImplementation(" org.testng:testng:7.8.0" )
26
- testImplementation(" com.redis.testcontainers:testcontainers-redis-junit:1.6.4" )
27
- testImplementation(" org.testcontainers:postgresql:1.19.7" )
28
- testImplementation(" org.springframework.boot:spring-boot-starter-test" )
29
28
testImplementation(" org.springframework.security:spring-security-test" )
30
29
testImplementation(" org.springframework.restdocs:spring-restdocs-mockmvc" )
31
30
}
@@ -47,6 +46,8 @@ tasks.withType<JibTask> {
47
46
}
48
47
49
48
tasks.register<Copy >(" copySubProjectsOpenAPIFiles" ) {
49
+ group = " openapi"
50
+ description = " Copy all subprojects openapi.yaml files into \$ buildDir/tmp/openapi"
50
51
// By convention, we expect OpenAPI files for sub-projects to be named and placed as follows:
51
52
// <subproject>/src/main/openapi/<subproject>.yaml
52
53
// For example: organization/src/main/openapi/organization.yaml
@@ -105,6 +106,8 @@ tasks.getByName<OpenApiMergerTask>("mergeOpenApiFiles") {
105
106
}
106
107
107
108
tasks.register<GenerateTask >(" openApiTypescriptGenerate" ) {
109
+ group = " openapi-ts"
110
+ description = " Generate OpenAPI TypeScript-Axios client"
108
111
dependsOn(" mergeOpenApiFiles" )
109
112
inputSpec.set(" ${rootDir} /openapi/openapi.yaml" )
110
113
outputDir.set(" ${layout.buildDirectory.get()} /generated-sources/openapi/typescript" )
@@ -116,22 +119,32 @@ tasks.register<GenerateTask>("openApiTypescriptGenerate") {
116
119
}
117
120
118
121
tasks.register<Copy >(" copyTypescriptGitPushScript" ) {
122
+ group = " openapi-ts"
123
+ description =
124
+ " Copy generated Typescript-Axios client project to \$ buildDir/generated-sources/openapi/typescript/scripts"
119
125
dependsOn(" openApiTypescriptGenerate" )
120
126
from(" ${rootDir} /scripts/clients/build_override/git_push.sh" )
121
127
into(" ${layout.buildDirectory.get()} /generated-sources/openapi/typescript/scripts" )
122
128
}
123
129
124
130
tasks.register<Copy >(" copyTypescriptLicense" ) {
131
+ group = " openapi-ts"
132
+ description =
133
+ " Copy generated Typescript-Axios LICENSE file to \$ buildDir/generated-sources/openapi/typescript/scripts"
125
134
dependsOn(" openApiTypescriptGenerate" )
126
135
from(" ${rootDir} /scripts/clients/build_override/LICENSE" )
127
136
into(" ${layout.buildDirectory.get()} /generated-sources/openapi/typescript" )
128
137
}
129
138
130
139
tasks.register(" generateTypescriptClient" ) {
140
+ group = " openapi-ts"
141
+ description = " Push generated Typescript-Axios client project to dedicated github repository"
131
142
dependsOn(" copyTypescriptGitPushScript" , " copyTypescriptLicense" )
132
143
}
133
144
134
145
tasks.register<GenerateTask >(" openApiPythonGenerate" ) {
146
+ group = " openapi-python"
147
+ description = " Generate OpenAPI Python client"
135
148
dependsOn(" mergeOpenApiFiles" )
136
149
inputSpec.set(" ${rootDir} /openapi/openapi.yaml" )
137
150
outputDir.set(" ${layout.buildDirectory.get()} /generated-sources/openapi/python" )
@@ -146,18 +159,27 @@ tasks.register<GenerateTask>("openApiPythonGenerate") {
146
159
// PROD-14252: temporary fix waiting for upstream resolution of
147
160
// https://github.com/OpenAPITools/openapi-generator/pull/20701
148
161
tasks.register<Copy >(" overwriteGeneratedPythonFile" ) {
162
+ group = " openapi-python"
163
+ description =
164
+ " Patch OpenAPI Python client (temporary fix OpenAPITools/openapi-generator/pull/20701)"
149
165
dependsOn(" openApiPythonGenerate" )
150
166
from(" ${rootDir} /scripts/clients/patches/python.yml" )
151
167
into(" ${layout.buildDirectory.get()} /generated-sources/openapi/python/.github/workflows/" )
152
168
}
153
169
154
170
tasks.register<Copy >(" copyPythonGitPushScript" ) {
171
+ group = " openapi-python"
172
+ description =
173
+ " Copy generated Python client project to \$ buildDir/generated-sources/openapi/python/scripts"
155
174
dependsOn(" openApiPythonGenerate" )
156
175
from(" ${rootDir} /scripts/clients/build_override/git_push.sh" )
157
176
into(" ${layout.buildDirectory.get()} /generated-sources/openapi/python/scripts" )
158
177
}
159
178
160
179
tasks.register<Copy >(" copyPythonLicense" ) {
180
+ group = " openapi-python"
181
+ description =
182
+ " Copy generated Python LICENSE file to \$ buildDir/generated-sources/openapi/python/scripts"
161
183
dependsOn(" openApiPythonGenerate" )
162
184
from(" ${rootDir} /scripts/clients/build_override/LICENSE" )
163
185
into(" ${layout.buildDirectory.get()} /generated-sources/openapi/python" )
@@ -166,21 +188,29 @@ tasks.register<Copy>("copyPythonLicense") {
166
188
// PROD-14252: temporary fix waiting for upstream resolution
167
189
// of https://github.com/OpenAPITools/openapi-generator/pull/20701
168
190
tasks.register(" generatePythonClient" ) {
191
+ group = " openapi-python"
192
+ description = " Push generated Python client project to dedicated github repository"
169
193
dependsOn(" copyPythonGitPushScript" , " copyPythonLicense" , " overwriteGeneratedPythonFile" )
170
194
}
171
195
172
196
tasks.register<GenerateTask >(" openApiUmlGenerate" ) {
197
+ group = " documentation"
198
+ description = " Generate OpenAPI UML schema"
173
199
dependsOn(" mergeOpenApiFiles" )
174
200
inputSpec.set(" ${rootDir} /openapi/openapi.yaml" )
175
201
outputDir.set(" $rootDir /openapi/plantuml" )
176
202
generatorName.set(" plantuml" )
177
203
}
178
204
179
205
tasks.register<Delete >(" openApiMarkdownClean" ) {
206
+ group = " documentation"
207
+ description = " Remove MD files generated"
180
208
delete(" $rootDir /doc/Apis" , " $rootDir /doc/Models" )
181
209
}
182
210
183
211
tasks.register<GenerateTask >(" openApiMarkdownGenerate" ) {
212
+ group = " documentation"
213
+ description = " Generate MD documentation files"
184
214
dependsOn(" mergeOpenApiFiles" , " openApiMarkdownClean" )
185
215
inputSpec.set(" ${rootDir} /openapi/openapi.yaml" )
186
216
outputDir.set(" $rootDir /doc" )
@@ -195,6 +225,8 @@ tasks.getByName<ValidateTask>("openApiValidate") {
195
225
}
196
226
197
227
tasks.register(" generateClients" ) {
228
+ group = " openapi"
229
+ description = " Generate Python and TS API clients, UML and Markdown documentation"
198
230
dependsOn(
199
231
" generateTypescriptClient" ,
200
232
" generatePythonClient" ,
@@ -213,32 +245,6 @@ tasks.withType<GenerateTask> {
213
245
outputs.upToDateWhen { false }
214
246
}
215
247
216
- tasks.register<Exec >(" rolloutKindDeployment" ) {
217
- dependsOn(" jib" )
218
- var apiVersion = " latest"
219
- var namespace = " phoenix"
220
- var clusterName = " kind-local-k8s-cluster"
221
- if (project.hasProperty(" rollout.apiVersion" )) {
222
- apiVersion = project.property(" rollout.apiVersion" ).toString()
223
- }
224
- if (project.hasProperty(" rollout.namespace" )) {
225
- namespace = project.property(" rollout.namespace" ).toString()
226
- }
227
- if (project.hasProperty(" rollout.clusterName" )) {
228
- clusterName = project.property(" rollout.clusterName" ).toString()
229
- }
230
-
231
- commandLine(
232
- " kubectl" ,
233
- " --context" ,
234
- clusterName,
235
- " -n" ,
236
- namespace,
237
- " rollout" ,
238
- " restart" ,
239
- " deployment/cosmotech-api-${apiVersion} " )
240
- }
241
-
242
248
tasks.register<GenerateTask >(" generateDocumentation" ) {
243
249
group = " documentation"
244
250
description = " Generates adoc file containing API documentation"
0 commit comments