blob: 6d748b1e62957b86a8ab4755ff8eb07b1d04732e [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'java'
id 'signing'
alias(libs.plugins.docker)
alias(libs.plugins.nebula)
alias(libs.plugins.checksum)
}
import org.gradle.crypto.checksum.Checksum
configurations {
dbArtifacts
cliArtifacts
cliScripts
cliZip
dbZip
}
dependencies {
dbArtifacts(project(':ignite-runner'))
cliArtifacts(project(':ignite-cli'))
cliScripts(project(path: ':ignite-cli', configuration: 'cliScripts'))
cliZip(project(path: ':packaging-cli', configuration: 'cliZip'))
dbZip(project(path: ':packaging-db', configuration: 'dbZip'))
}
docker {
name 'apacheignite/ignite3'
dockerfile file('docker/Dockerfile')
copySpec.into 'dist', {
into('') {
File.createTempDir().with {
['etc', 'work'].each { new File(absolutePath, it).mkdirs() }
from(absolutePath) {
includeEmptyDirs = true
}
}
from("$rootDir/LICENSE")
from("$rootDir/NOTICE")
from("$rootDir/assembly/README.md")
}
into('etc') {
from('config/ignite-config.conf')
from('docker/ignite.java.util.logging.properties')
}
into('bin') {
fileMode 0755
from('docker/docker-entrypoint.sh')
}
into('lib') {
from(configurations.dbArtifacts)
}
}
}
// create an uber zip with all distributions
task copyCliAndDbZip(type: Copy) {
from(configurations.cliZip)
from(configurations.dbZip)
into("$buildDir/tmp/zip/")
}
task allDistZip(type: Zip) {
archiveBaseName = "ignite3"
def allZipFiles = configurations.cliZip + configurations.dbZip
allZipFiles.each {
from(zipTree(it))
}
}
task createDistZipChecksums(type: Checksum) {
//TODO: remove distribution name hard code IGNITE-18092
files = files(files("${buildDir}/distributions/ignite3-${project.version}.zip"))
outputDir = new File("${buildDir}/distributions")
algorithm = Checksum.Algorithm.SHA512
}
task createSrcZipChecksums(type: Checksum) {
//TODO: remove distribution name hard code IGNITE-18092
files = files(files("${buildDir}/distributions/apache-ignite-${project.version}-src.zip"))
outputDir = new File("${buildDir}/distributions")
algorithm = Checksum.Algorithm.SHA512
}
allDistZip.finalizedBy(createDistZipChecksums)
task allSrcZip(type: Exec) {
workingDir rootDir
commandLine "git", "archive",
"--prefix=apache-ignite-${project.version}-src",
"-o", "$buildDir/distributions/apache-ignite-${project.version}-src.zip",
"HEAD"
}
task buildAndSignAllSrcZip(type: Sign) {
dependsOn allSrcZip, createSrcZipChecksums
sign file("$buildDir/distributions/apache-ignite-${project.version}-src.zip")
}
// copyCliAndDbZip depends on configurations.cliZip and configurations.dbZip
// it makes allDistZip be depended on configurations.cliZip and configurations.dbZip
// https://issues.apache.org/jira/browse/IGNITE-17918
allDistZip.dependsOn copyCliAndDbZip
signing {
sign allDistZip
}