-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy.gradle
73 lines (56 loc) · 2.6 KB
/
deploy.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
/*
Website - deploy to CloudFoundry PaaS Service provider named anynines.com @ http://gpars.aws.ie.a9sapp.eu/
To manually deploy this site using the CF command-line tool - :
cd /Users/jim/Dropbox/Project/Website
cf push gpars -b https://github.com/cloudfoundry/java-buildpack.git -p build/libs/Website.war
This is a sample gradle script using the gradle plugin for cloud foundry to upload our war file to target PaaS service, anynines.com in Berlin.
Use this gradle script syntax to automatically deploy using defaultTasks ('cd' into this folder then from a terminal type):
cd /Users/jim/Dropbox/Project/Website
./gradlew -b deploy.gradle
Use this script syntax to manually deploy ('cd' into this folder then from a terminal type):
cd /Users/jim/Dropbox/Project/Website
./gradlew -b deploy.gradle cfLogin cfDelete cfPush
NOTE: This deploy script requires your system to have Java JRE 1.7+ also first fill in username and password credentials below
*/
buildscript {
repositories {
mavenLocal()
jcenter()
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
}
dependencies {
classpath group: 'org.cloudfoundry', name: 'cf-gradle-plugin', version: "${cfGradlePluginVersion}"
}
}
repositories {
mavenLocal()
jcenter()
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
}
apply plugin: 'war'
apply plugin: 'cloudfoundry'
defaultTasks 'cfLogin','cfPush' // 'cfDelete',
dependencies {
compile "org.codehaus.groovy:groovy-all:${groovyVersion}"
runtime "redis.clients:jedis:${jedisVersion}"
}
war {
archiveName 'Website.war'
from 'src/main/resources' // adds a file-set to the root of the archive
}
cloudfoundry {
// your credentials go here
username = '' // credentials used to join your CloudFoundry provider
password = ''
target = 'https://api.aws.ie.a9sapp.eu' // cloud foundry target address for your choice of providers; this address is for anynines.com
space = 'development'
file = new File('build/libs/Website.war') // if you rename the root folder from Website then your .war filename must reflect that
uri = 'http://gpars.aws.ie.a9sapp.eu/' // if you choose another name than gparsdocs for this site when deployed, put that new name here and in the application value below
application = 'GPars' // make this same as uri bit
memory = 320 // MB - varys depending on vendor
instances = 1
// redis is the tool to provide caching in Caelyf tool but is optional and still works without it
services {"rediscloud" { label = 'redis'
provider = 'Garantiadata'
plan = '100' } }
}