Newer
Older
/*
* 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', 'mariadb-tomcat', 'postgres-tomcat']

Vincent Massol
committed
// Notes:
// - To compute the XWiki sha256, download the XWiki WAR and issue:
// - Unix: sha256sum <binary name>
// - Mac: shasum --algorithm 256 <binary name>
// - To compute the mysql JDBC sha256, get the JAR at https://search.maven.org/artifact/mysql/mysql-connector-java and
// do the same as for the XWiki sha256.
// - To compute the mysql JDBC sha256, get the JAR at
// https://search.maven.org/artifact/org.mariadb.jdbc/mariadb-java-client and do the same as for the XWiki sha256.
// - Use the JDBC driver versions found in the XWiki POM for the specified versions:
// - mysql: https://github.com/xwiki/xwiki-platform/blob/master/pom.xml#L97 (link for master)
// - mariadb: https://github.com/xwiki/xwiki-platform/blob/master/pom.xml#L100 (link for master)
def tokens = [
xwikiVersion: '14.9',
xwikiSha256: '9a8639b590b2612c1603ac6788fe83b4d79dbaad484cc5c60230c00f16781460',
mysqlJDBCVersion: '8.0.30',
mysqlJDBCSha256: 'b5bf2f0987197c30adf74a9e419b89cda4c257da2d1142871f508416d5f2227a',
mariadbJDBCVersion: '3.0.9',
mariadbJDBCSha256: '2a004c8ab43173a2a0d10d25aadfc57b8012fe1f68bbd816196df814b5000c1a'
xwikiVersion: '14.4.6',
xwikiSha256: 'd5c6c9c027b19776a4d0b56af7472f4e9113b8953b1d39e9dac98d6bed1fcb16',
mysqlJDBCVersion: '8.0.30',
mysqlJDBCSha256: 'b5bf2f0987197c30adf74a9e419b89cda4c257da2d1142871f508416d5f2227a',
mariadbJDBCVersion: '3.0.9',
mariadbJDBCSha256: '2a004c8ab43173a2a0d10d25aadfc57b8012fe1f68bbd816196df814b5000c1a'
xwikiVersion: '13.10.10',
xwikiSha256: 'bae87a16d291d321d0848fcba55e455bfcd4b1890597cd9b735d98013cf44bad',
mysqlJDBCVersion: '8.0.30',
mysqlJDBCSha256: 'b5bf2f0987197c30adf74a9e419b89cda4c257da2d1142871f508416d5f2227a',
mariadbJDBCVersion: '3.0.9',
mariadbJDBCSha256: '2a004c8ab43173a2a0d10d25aadfc57b8012fe1f68bbd816196df814b5000c1a'
]
]
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}/*"
filteringCharset = 'UTF-8'
}
}
}
}
}