@@ -30,20 +30,20 @@ fun parseIgnoreFile(f: File): List<String> {
30
30
return ignores
31
31
}
32
32
33
-
34
33
// Use the node version that's defined in the .nvmrc file
35
- val nodeVersion = file(" ${ projectDir} /.nvmrc" ).readText().trim()
34
+ val nodeVersion = file(" $projectDir /.nvmrc" ).readText().trim()
36
35
37
36
// Read pnpm version to use from package.json engines.pnpm entry
38
- val parsedJson = JsonSlurper ().parse(FileReader (" ${ projectDir} /package.json" )) as Map <* , * > // Cast to Map
39
- val engines = parsedJson[" engines" ] as ? Map <* , * > // Safely cast to Map if 'engines' exists
40
- val pnpmVer = engines?.get(" pnpm" )?.toString()?.trim() // Extract 'pnpm' as String and trim
37
+ val parsedJson = JsonSlurper ().parse(FileReader (" $projectDir /package.json" )) as Map <* , * > // Cast to Map
38
+ val engines = parsedJson[" engines" ] as ? Map <* , * > // Safely cast to Map if 'engines' exists
39
+ val pnpmVer = engines?.get(" pnpm" )?.toString()?.trim() // Extract 'pnpm' as String and trim
41
40
42
41
/* *
43
42
* A list of all files outside the webapp folder, that the webapp build depends on, i.e.
44
43
* if those change we can't reuse a cached build.
45
44
*/
46
- val outsideWebappDependencies = listOf (
45
+ val outsideWebappDependencies =
46
+ listOf (
47
47
project(" :oss:airbyte-api:server-api" ).file(" src/main/openapi/config.yaml" ).path,
48
48
project(" :oss:airbyte-api:problems-api" ).file(" src/main/openapi/api-problems.yaml" ).path,
49
49
project(" :oss:airbyte-connector-builder-server" ).file(" src/main/openapi/openapi.yaml" ).path,
@@ -68,19 +68,21 @@ tasks.named("pnpmInstall") {
68
68
/*
69
69
Add patches folder to inputs of pnpmInstall task, since it has pnpm-lock.yml as an output
70
70
thus wouldn't rerun in case a patch get changed
71
- */
71
+ */
72
72
inputs.dir(" patches" )
73
73
}
74
74
75
75
// fileTree to watch node_modules, but exclude the .cache dir since that might have changes on every build
76
- val nodeModules = fileTree(" node_modules" ) {
76
+ val nodeModules =
77
+ fileTree(" node_modules" ) {
77
78
exclude(" .cache" )
78
79
}
79
80
80
81
/* *
81
82
* All files inside the webapp folder that aren't gitignored
82
83
*/
83
- val allFiles = fileTree(" ." ) {
84
+ val allFiles =
85
+ fileTree(" ." ) {
84
86
exclude(parseIgnoreFile(file(" ../.gitignore" )))
85
87
exclude(parseIgnoreFile(file(" .gitignore" )))
86
88
exclude(parseIgnoreFile(file(" ./src/core/api/generated/.gitignore" )))
@@ -115,14 +117,14 @@ tasks.register<PnpmTask>("pnpmBuild") {
115
117
116
118
tasks.register<PnpmTask >(" test" ) {
117
119
dependsOn(" pnpmInstall" )
118
-
120
+
119
121
args = listOf (" run" , " test:ci" )
120
122
inputs.files(allFiles, outsideWebappDependencies)
121
123
122
124
/*
123
125
The test has no outputs, thus we always treat the outputs up to date
124
126
as long as the inputs have not changed
125
- */
127
+ */
126
128
outputs.upToDateWhen { true }
127
129
}
128
130
@@ -132,9 +134,10 @@ tasks.register<PnpmTask>("cypress") {
132
134
/*
133
135
If the cypressWebappKey property has been set from the outside via the workflow file
134
136
we'll record the cypress session, otherwise we're not recording
135
- */
137
+ */
136
138
val hasRecordingKey = ! System .getenv(" CYPRESS_RECORD_KEY" ).isNullOrEmpty()
137
- args = if (hasRecordingKey && System .getProperty(" cypressRecord" , " false" ) == " true" ) {
139
+ args =
140
+ if (hasRecordingKey && System .getProperty(" cypressRecord" , " false" ) == " true" ) {
138
141
val group = System .getenv(" CYPRESS_GROUP" ) ? : " default-group"
139
142
listOf (" run" , " cypress:run" , " --record" , " --group" , group)
140
143
} else {
@@ -144,7 +147,7 @@ tasks.register<PnpmTask>("cypress") {
144
147
/*
145
148
Mark the outputs as never up to date, to ensure we always run the tests.
146
149
We want this because they are e2e tests and can depend on other factors e.g., external dependencies.
147
- */
150
+ */
148
151
outputs.upToDateWhen { false }
149
152
}
150
153
@@ -211,8 +214,9 @@ tasks.register<PnpmTask>("buildStorybook") {
211
214
212
215
outputs.dir(" build/storybook" )
213
216
214
- environment = mapOf (
215
- " NODE_OPTIONS" to " --max_old_space_size=8192"
217
+ environment =
218
+ mapOf (
219
+ " NODE_OPTIONS" to " --max_old_space_size=8192" ,
216
220
)
217
221
}
218
222
@@ -240,6 +244,7 @@ tasks.named("build") {
240
244
tasks.register<DockerBuildxTask >(TASK_DOCKER_BUILD ) {
241
245
dependsOn(" copyNginx" , " copyBuildOutput" )
242
246
imageName = " webapp"
247
+ dockerfile = project.layout.projectDirectory.file(" Dockerfile" )
243
248
244
249
if (cloudEnv.isNotEmpty()) {
245
250
buildArgs.put(" NGINX_CONFIG" , " bin/nginx/cloud.conf.template" )
0 commit comments