forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
146 lines (121 loc) · 5.36 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
plugins {
id 'application'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.0'
}
// This is published as a shadow jar as the Airbyte Server jar is currently used
// as a delivery mechanism for the common Airbyte libraries and clients. Proper
// publishing is blocked on some gradle work.
shadowJar {
zip64 true
mergeServiceFiles()
exclude 'META-INF/*.RSA'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
// Not stubbing this out adds 'all' to the end of the jar's name.
classifier = ''
}
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
}
}
repositories {
publications {
// This block is present so Gradle knows to publish a Maven jar.
maven(MavenPublication) {
from components.java
// Gradle will by default use the subproject path as the group id and the subproject name as the artifact id.
// e.g. the subproject :airbyte-scheduler:models is imported at io.airbyte.airbyte-config:persistence:<version-number>.
}
}
maven {
credentials {
name 'cloudrepo'
username System.getenv('CLOUDREPO_USER')
password System.getenv('CLOUDREPO_PASSWORD')
}
url 'https://airbyte.mycloudrepo.io/repositories/airbyte-public-jars'
}
mavenLocal()
}
}
dependencies {
implementation 'io.temporal:temporal-sdk:1.8.1'
implementation 'org.apache.cxf:cxf-core:3.4.2'
implementation 'commons-cli:commons-cli:1.4'
implementation 'org.eclipse.jetty:jetty-server:9.4.31.v20200723'
implementation 'org.eclipse.jetty:jetty-servlet:9.4.31.v20200723'
implementation 'org.glassfish.jaxb:jaxb-runtime:3.0.2'
implementation 'org.glassfish.jersey.containers:jersey-container-servlet'
implementation 'org.glassfish.jersey.inject:jersey-hk2'
implementation 'org.glassfish.jersey.media:jersey-media-json-jackson'
implementation 'org.glassfish.jersey.ext:jersey-bean-validation'
implementation "org.flywaydb:flyway-core:7.14.0"
implementation 'com.github.slugify:slugify:2.4'
implementation project(':airbyte-analytics')
implementation project(':airbyte-api')
implementation project(':airbyte-commons-docker')
implementation project(':airbyte-config:init')
implementation project(':airbyte-config:models')
implementation project(':airbyte-config:persistence')
implementation project(':airbyte-config:specs')
implementation project(':airbyte-db:lib')
implementation project(":airbyte-json-validation")
implementation project(':airbyte-notification')
implementation project(':airbyte-oauth')
implementation project(':airbyte-protocol:models')
implementation project(':airbyte-scheduler:app')
implementation project(':airbyte-scheduler:client')
implementation project(':airbyte-scheduler:models')
implementation project(':airbyte-scheduler:persistence')
implementation project(':airbyte-workers')
testImplementation "org.postgresql:postgresql:42.2.18"
testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.1'
testImplementation "org.testcontainers:postgresql:1.15.3"
}
// we want to be able to access the generated db files from config/init when we build the server docker image.
task copySeed(type: Copy, dependsOn: [project(':airbyte-config:init').processResources]) {
from "${project(':airbyte-config:init').buildDir}/resources/main/config"
into "${buildDir}/config_init/resources/main/config"
}
// need to make sure that the files are in the resource directory before copying.
// tests require the seed to exist.
test.dependsOn(project.tasks.copySeed)
assemble.dependsOn(project.tasks.copySeed)
mainClassName = 'io.airbyte.server.ServerApp'
application {
mainClass = mainClassName
applicationDefaultJvmArgs = ['-XX:+ExitOnOutOfMemoryError', '-XX:MaxRAMPercentage=75.0']
}
Properties env = new Properties()
rootProject.file('.env.dev').withInputStream { env.load(it) }
run {
// default for running on local machine.
environment "DATABASE_USER", env.DATABASE_USER
environment "DATABASE_PASSWORD", env.DATABASE_PASSWORD
environment "CONFIG_DATABASE_USER", env.CONFIG_DATABASE_USER
environment "CONFIG_DATABASE_PASSWORD", env.CONFIG_DATABASE_PASSWORD
// we map the docker pg db to port 5433 so it does not conflict with other pg instances.
environment "DATABASE_URL", "jdbc:postgresql://localhost:5433/${env.DATABASE_DB}"
environment "CONFIG_DATABASE_URL", "jdbc:postgresql://localhost:5433/${env.CONFIG_DATABASE_DB}"
environment "RUN_DATABASE_MIGRATION_ON_STARTUP", "true"
environment "WORKSPACE_ROOT", env.WORKSPACE_ROOT
environment "CONFIG_ROOT", "/tmp/airbyte_config"
environment "TRACKING_STRATEGY", env.TRACKING_STRATEGY
environment "AIRBYTE_VERSION", env.VERSION
environment "AIRBYTE_ROLE", System.getenv('AIRBYTE_ROLE')
environment "TEMPORAL_HOST", "localhost:7233"
}
task copyGeneratedTar(type: Copy) {
dependsOn copyDocker
dependsOn distTar
from('build/distributions') {
include 'airbyte-server-*.tar'
}
into 'build/docker/bin'
}
Task dockerBuildTask = getDockerBuildTask("server", "$project.projectDir")
dockerBuildTask.dependsOn(copyGeneratedTar)
assemble.dependsOn(dockerBuildTask)