comparison build.gradle @ 2:91703efb1d29

update ssdt-forms and dockerize
author smith@nwoca.org
date Mon, 11 Apr 2016 11:53:50 -0400
parents f4f8570d1c56
children
comparison
equal deleted inserted replaced
1:dddcb6d16927 2:91703efb1d29
1 apply from: "${gradle.ext.has('ssdtDevelkitLocation') ? gradle.ssdtDevelkitLocation : 'http://hg.ssdt-ohio.org/browse/public/develkit'}/init.gradle" 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 }
2 16
3 description = "ssdt.forms application" 17 description = "ssdt.forms application"
4 18
5 apply plugin: "war" 19 apply plugin: "war"
6 apply plugin: "java" 20 apply plugin: "java"
7 apply plugin: "groovy" 21 apply plugin: "groovy"
8 apply plugin: "jetty" 22 apply plugin: "jetty"
9 apply plugin: "idea" 23 apply plugin: "idea"
10 24 apply plugin: 'com.bmuschko.docker-remote-api'
11 25
12 sourceCompatibility = "1.5" 26 sourceCompatibility = "1.5"
13 targetCompatibility = "1.5" 27 targetCompatibility = "1.5"
14 28
15 group = "org.ssdt_ohio" 29 group = "org.ssdt_ohio"
16 version = "1.0-SNAPSHOT" 30 version = "1.0-SNAPSHOT"
17
18 /*
19 repositories {
20 mavenCentral()
21
22 // All things JBoss/Hibernate
23 mavenRepo name: "JBoss", url: "http://repository.jboss.org/nexus/content/groups/public/"
24
25 // For stable versions of the tapx libraries
26 mavenRepo name: "HLS", url: "http://howardlewisship.com/repository/"
27
28 // For non-stable versions of the tapx libraries
29 mavenRepo name: "HLS Snapshots", url: "http://howardlewisship.com/snapshot-repository/"
30
31 // For access to Apache Staging (Preview) packages
32 mavenRepo name: "Apache Staging", url: "https://repository.apache.org/content/groups/staging"
33 }
34 */
35
36 // This simulates Maven's "provided" scope, until it is officially supported by Gradle
37 // See http://jira.codehaus.org/browse/GRADLE-784
38 31
39 configurations { 32 configurations {
40 provided 33 provided
41 } 34 }
42 35
50 } 43 }
51 } 44 }
52 45
53 dependencies { 46 dependencies {
54 47
55 groovy 'org.codehaus.groovy:groovy-all:2.0.1' 48 compile 'org.codehaus.groovy:groovy-all:2.4.5'
56 compile "org.apache.tapestry:tapestry-core:5.3.6" 49 compile "org.apache.tapestry:tapestry-core:5.3.8"
57 compile(group: 'me.davesmith', name: 'tapestry-bootstrap', version: '2.1-SNAPSHOT') 50 compile(group: 'me.davesmith', name: 'tapestry-bootstrap', version: '2.1-SNAPSHOT')
58 compile group: 'org.got5', name: 'tapestry5-jquery', version: '3.2.0' 51 compile group: 'org.got5', name: 'tapestry5-jquery', version: '3.3.6'
59 compile "org.apache.tapestry:tapestry-yuicompressor:5.3.6" 52 compile "org.apache.tapestry:tapestry-yuicompressor:5.3.6"
60 53
61 // Uncomment this to add support for file uploads: 54 // Uncomment this to add support for file uploads:
62 // compile "org.apache.tapestry:tapestry-upload:5.3.6" 55 // compile "org.apache.tapestry:tapestry-upload:5.3.6"
63 56
82 75
83 jettyRun { 76 jettyRun {
84 webAppSourceDirectory = file("src/main/webapp") 77 webAppSourceDirectory = file("src/main/webapp")
85 httpPort = 8086 78 httpPort = 8086
86 } 79 }
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