2
|
1 import java.time.Instant
|
|
2 import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
|
|
3 import com.bmuschko.gradle.docker.tasks.image.Dockerfile
|
|
4
|
|
5 apply from: "${gradle.ext.has('ssdtDevelkitLocation') ? gradle.ssdtDevelkitLocation : 'http://hg.ssdt-ohio.org/browse/public/develkit'}/init20.gradle"
|
|
6
|
|
7 buildscript {
|
|
8 repositories {
|
|
9 maven { url 'http://repos.ssdt.nwoca.org/artifactory/gradle-plugins' }
|
|
10 maven { url 'http://repos.ssdt.nwoca.org/artifactory/repo' }
|
|
11 }
|
|
12 dependencies {
|
|
13 classpath 'com.bmuschko:gradle-docker-plugin:2.6.5'
|
|
14 }
|
|
15 }
|
0
|
16
|
|
17 description = "ssdt.forms application"
|
|
18
|
|
19 apply plugin: "war"
|
|
20 apply plugin: "java"
|
|
21 apply plugin: "groovy"
|
|
22 apply plugin: "jetty"
|
|
23 apply plugin: "idea"
|
2
|
24 apply plugin: 'com.bmuschko.docker-remote-api'
|
0
|
25
|
|
26 sourceCompatibility = "1.5"
|
|
27 targetCompatibility = "1.5"
|
|
28
|
|
29 group = "org.ssdt_ohio"
|
|
30 version = "1.0-SNAPSHOT"
|
|
31
|
|
32 configurations {
|
|
33 provided
|
|
34 }
|
|
35
|
|
36 sourceSets {
|
|
37 main {
|
|
38 compileClasspath += configurations.provided
|
|
39 }
|
|
40 test {
|
|
41 compileClasspath += configurations.provided
|
|
42 runtimeClasspath += configurations.provided
|
|
43 }
|
|
44 }
|
|
45
|
|
46 dependencies {
|
|
47
|
2
|
48 compile 'org.codehaus.groovy:groovy-all:2.4.5'
|
|
49 compile "org.apache.tapestry:tapestry-core:5.3.8"
|
0
|
50 compile(group: 'me.davesmith', name: 'tapestry-bootstrap', version: '2.1-SNAPSHOT')
|
2
|
51 compile group: 'org.got5', name: 'tapestry5-jquery', version: '3.3.6'
|
0
|
52 compile "org.apache.tapestry:tapestry-yuicompressor:5.3.6"
|
|
53
|
|
54 // Uncomment this to add support for file uploads:
|
|
55 // compile "org.apache.tapestry:tapestry-upload:5.3.6"
|
|
56
|
|
57 provided "javax.servlet:servlet-api:2.5"
|
|
58 }
|
|
59
|
|
60 test {
|
|
61 useTestNG()
|
|
62
|
|
63 options.suites("src/test/conf/testng.xml")
|
|
64
|
|
65 systemProperties["tapestry.service-reloading-enabled"] = "false"
|
|
66 systemProperties["tapestry.execution-mode"] = "development"
|
|
67
|
|
68 maxHeapSize = "600M"
|
|
69
|
|
70 jvmArgs("-XX:MaxPermSize=256M")
|
|
71
|
|
72 enableAssertions = true
|
|
73 }
|
|
74
|
|
75
|
|
76 jettyRun {
|
|
77 webAppSourceDirectory = file("src/main/webapp")
|
|
78 httpPort = 8086
|
|
79 }
|
2
|
80
|
|
81
|
|
82 docker {
|
|
83 if (System.env.DOCKER_HOST) {
|
|
84 url = "https:${System.env.DOCKER_HOST?.minus('tcp:')}"
|
|
85 }
|
|
86 if (System.env.DOCKER_CERT_PATH) {
|
|
87 certPath = new File("$System.env.DOCKER_CERT_PATH")
|
|
88 }
|
|
89 }
|
|
90
|
|
91
|
|
92 war {
|
|
93 archiveName 'ssdtforms.war'
|
|
94 }
|
|
95
|
|
96 task createDockerfile(type: Dockerfile) {
|
|
97 group = "Docker"
|
|
98 destFile = project.file('build/docker/Dockerfile')
|
|
99 from 'docker.ssdt.io/ssdt-tomcat:3'
|
|
100 maintainer 'Dave Smith <smith@nwoca.org>'
|
|
101 label {
|
|
102 [
|
|
103 'io.ssdt.version' : version,
|
|
104 'io.ssdt.id' : "${project.name}",
|
|
105 'io.ssdt.type' : "webapp",
|
|
106 'io.ssdt.app' : "ssdtforms",
|
|
107 'io.ssdt.build.date' : Instant.now().toString(),
|
|
108 ]
|
|
109 }
|
|
110 copyFile("ssdtforms.war", '/usr/local/tomcat/webapps/ROOT.war')
|
|
111 }
|
|
112
|
|
113
|
|
114 task prepareDockerImage(type: Copy) {
|
|
115 group = "Docker"
|
|
116 dependsOn war
|
|
117 dependsOn createDockerfile
|
|
118 from war.getArchivePath()
|
|
119 into project.file('build/docker')
|
|
120 }
|
|
121
|
|
122 task buildDockerImage(type: DockerBuildImage) {
|
|
123 group = "Docker"
|
|
124 dependsOn prepareDockerImage
|
|
125 inputDir = createDockerfile.destFile.parentFile
|
|
126 tag = "ssdtforms:latest"
|
|
127 }
|
|
128
|
|
129
|