forked from xwiki/xwiki-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
85 lines (79 loc) · 3.22 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
/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
import org.apache.tools.ant.filters.ReplaceTokens
// Run this Gradle build with 'gradle' to generate the various versions and variants from the template directory.
// Whenever a new version of XWiki is out, update this file to update the token values, run gradle and commit the
// result.
//
// Note: As a consequence only update the template files and never the generated files!
defaultTasks 'generate'
def variants = ['mysql-tomcat', 'postgres-tomcat']
// Note: To compute the sha256, download the XWiki WAR and issue:
// - Unix: sha256sum <binary name>
// - Mac: shasum --algorithm 256 <binary name>
def tokens = [
'10' : [
xwikiVersion: '10.11.9',
xwikiSha256: '299fe60d5b32ee1a363ba48ff2346e78eea5f713a0174c20fe9d7531be426a58'
],
'11': [
xwikiVersion: '11.8.1',
xwikiSha256: 'fc08acd66e3b7f229bad301039de0be1dcae5fc2b360d985424215c324c4dc47'
]
]
task generate() {
doLast {
// Copy the template for all versions and variants
tokens.keySet().each() { version ->
variants.each() { variant ->
// Extract the db type and add it as a token
def (db, servlet) = variant.tokenize('-')
tokens[version].'db' = db
// Copy common template files, evaluating groovy in them
copy {
from 'template'
into "${version}/${variant}"
include '.env'
include 'Dockerfile'
include 'docker-compose.yml'
include 'xwiki/*'
expand(tokens[version])
filteringCharset = 'UTF-8'
}
// Copy DB-specific template files, evaluating groovy in them
copy {
from 'template'
into "${version}/${variant}"
include "${db}/*"
expand(tokens[version])
filteringCharset = 'UTF-8'
}
// Copy Servlet-specific template files, evaluating groovy in them
copy {
from 'template'
into "${version}/${variant}"
include "${servlet}/*"
expand(tokens[version])
filteringCharset = 'UTF-8'
}
}
}
}
}