forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
69 lines (54 loc) · 1.67 KB
/
build.gradle
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
67
68
69
plugins {
id "base"
id "com.github.node-gradle.node" version "3.1.1"
}
def nodeVersion = System.getenv('NODE_VERSION') ?: '16.13.0'
node {
download = true
version = nodeVersion
}
npm_run_build {
inputs.files fileTree('public')
inputs.files fileTree('src')
inputs.file 'package.json'
inputs.file 'package-lock.json'
// todo (cgardens) - the plugin seems to ignore this value when the copy command is run. ideally the output would be place in build/app.
outputs.dir project.buildDir
}
task test(type: NpmTask) {
dependsOn assemble
args = ['run', 'test', '--', '--watchAll=false', '--silent']
inputs.files fileTree('src')
inputs.file 'package.json'
inputs.file 'package-lock.json'
}
assemble.dependsOn npm_run_build
build.finalizedBy test
task copyBuild(type: Copy) {
dependsOn copyDocker
from "${project.projectDir}/build"
into "build/docker/bin/build"
exclude ".docker"
exclude "docker"
}
task copyDocs(type: Copy) {
dependsOn copyDocker
from "${project.rootProject.projectDir}/docs/integrations"
into "build/docker/bin/docs/integrations"
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
task copyNginx(type: Copy) {
dependsOn copyDocker
from "${project.projectDir}/nginx"
into "build/docker/bin/nginx"
}
copyBuild.dependsOn npm_run_build
copyNginx.dependsOn npm_run_build
copyDocs.dependsOn npm_run_build
assemble.dependsOn copyDocs
copyDocker.dependsOn(npm_run_build)
Task dockerBuildTask = getDockerBuildTask("webapp", "$project.projectDir")
dockerBuildTask.dependsOn(copyBuild)
dockerBuildTask.dependsOn(copyNginx)
dockerBuildTask.dependsOn(copyDocs)
assemble.dependsOn(dockerBuildTask)