This repository has been archived by the owner on May 25, 2023. It is now read-only.
forked from getodk/aggregate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker.gradle
47 lines (39 loc) · 2.89 KB
/
docker.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
import static org.opendatakit.aggregate.gradle.Util.setPropertiesValue
import static org.opendatakit.aggregate.gradle.Util.getVersionName
String buildTarget = "${buildDir}/docker".toString()
task dockerClean() {
delete "${buildTarget}"
}
task dockerPrepare(dependsOn: [dockerClean], type: Copy) {
into "${buildTarget}"
from fileTree(dir: 'docker')
into('webapps/ROOT') {
from zipTree("${buildDir}/libs/${archivesBaseName}-${version}.war")
}
doLast {
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/jdbc.properties", "jdbc.url", "jdbc:postgresql://127.0.0.1/odk_db?autoDeserialize=true")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/jdbc.properties", "jdbc.username", "odk_unit")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/jdbc.properties", "jdbc.password", "test")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/jdbc.properties", "jdbc.schema", "odk_db")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "security.server.realm.realmString", "ODK Aggregate")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "security.server.channelType", "ANY_CHANNEL")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "wink.handlersFactoryClass", "org.opendatakit.aggregate.odktables.impl.api.wink.AppEngineHandlersFactory")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "security.server.superUserUsername", "administrator")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "security.server.superUser", "")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "security.server.port", "8080")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "security.server.securePort", "8443")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "security.server.deviceAuthentication", "digest")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "security.server.hostname", "")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "security.server.secureChannelType", "ANY_CHANNEL")
setPropertiesValue("${buildTarget}/webapps/ROOT/WEB-INF/classes/security.properties", "security.help.about", "auto-generated on 1970-01-01T00:00:00+0000 for ODK Aggregate")
}
}
task dockerBuild(dependsOn: [build, dockerPrepare], type: Exec) {
workingDir "${buildTarget}"
commandLine 'docker', 'build', '-t', "aggregate:${getVersionName()}".toString(), '.'
doLast {
println ""
println "Your Aggregate Docker image is ready to run."
println "Please, refer to https://github.com/opendatakit/aggregate/tree/master/docs/build-and-run-a-docker-image.md for instructions."
}
}