-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle.kts
66 lines (61 loc) · 1.68 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
buildscript {
val isWindows = System.getProperty("os.name").lowercase().contains("win");
if (isWindows) {
extra.set("npm", "npm.cmd");
extra.set("npx", "npx.cmd");
} else {
extra.set("npm", "npm");
extra.set("npx", "npx");
}
}
val excludedAppBuildProjects = listOf(
"src",
"echo-plugin-examples",
"echo-plugins",
"ggg-test-env",
"insights",
"insights-cache-updater",
"sage-aws-cdk",
"sage-docs",
"sage-ts-tooling",
"tactics-api",
"tactics-image-gen"
)
val appBuildNpmInstall = task("appBuildNpmInstall")
gradle.projectsEvaluated {
subprojects.filter {
!excludedAppBuildProjects.contains(it.name)
}.forEach { appBuildNpmInstall.dependsOn(it.tasks.named("npmInstall")) }
}
val appBuildNpmBuild = task("appBuildNpmBuild")
gradle.projectsEvaluated {
subprojects.filter {
!excludedAppBuildProjects.contains(it.name)
}.forEach { appBuildNpmBuild.dependsOn(it.tasks.named("npmBuild")) }
}
val buildPlugins = task("buildPlugins")
gradle.projectsEvaluated {
subprojects.filter {
it.path.contains("echo-plugin-examples:") ||
it.path.contains("echo-plugins:")
}.forEach { buildPlugins.dependsOn(it.tasks.named("npmBuild")) }
}
task("dockerBuildAndPublish") {
val packageName = "poestack-tactics-apix"
doLast {
exec {
commandLine("docker", "build", "--platform=linux/amd64", "--progress=plain", "-t", packageName, ".")
}
exec {
commandLine(
"docker",
"tag",
"${packageName}:latest",
"604080725100.dkr.ecr.us-east-1.amazonaws.com/${packageName}:latest"
)
}
exec {
commandLine("docker", "push", "604080725100.dkr.ecr.us-east-1.amazonaws.com/${packageName}:latest")
}
}
}