Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-16880: Add OAS to 'assembleRelease' task #2125

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion dev-tools/scripts/buildAndPushRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
import scriptutil

LOG = '/tmp/release.log'
dev_mode = False
# NOCOMMIT
dev_mode = True

def log(msg):
f = open(LOG, mode='ab')
Expand Down
5 changes: 3 additions & 2 deletions solr/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ext {
jsClientDir = "${buildDir}/generated/js"
pythonClientDir = "${buildDir}/generated/python"
openApiSpecDir = "${buildDir}/generated/openapi"
openApiSpecFile = "${project.openApiSpecDir}/openapi.json"
openApiSpecFile = "${project.openApiSpecDir}/solr-${version}-openapi.json"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For JARs, the version is at the end. Maybe we should do similar? Just a thought.

}

configurations {
Expand All @@ -50,6 +50,7 @@ resolve {
classpath = sourceSets.main.runtimeClasspath
resourcePackages = ["org.apache.solr.client.api.util", "org.apache.solr.client.api.endpoint"]
outputDir = file(project.openApiSpecDir)
outputFileName = "solr-${version}-openapi"
prettyPrint = true
}

Expand Down Expand Up @@ -91,7 +92,7 @@ tasks.withType(org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {

artifacts {
// Ensure the OAS is available to other modules who want to generate code (i.e. solrj)
openapiSpec resolve.outputDir, {
openapiSpec file(openApiSpecFile), {
builtBy resolve
}

Expand Down
37 changes: 34 additions & 3 deletions solr/distribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ apply from: buildscript.sourceFile.toPath().resolveSibling("source-release.gradl
// Set up the HTML-rendered "changes" distribution artifact by linking to documentation's output.
configurations {
changesHtml
openApiSpecFile
docker
}

dependencies {
changesHtml project(path: ":solr:documentation", configuration: "changesHtml")
openApiSpecFile project(path: ":solr:api", configuration: "openapiSpec")
docker project(path: ':solr:docker', configuration: 'packagingOfficial')
}

Expand All @@ -73,11 +75,13 @@ task computeChecksums(type: Checksum) {
[
tasks.assembleSourceTgz,
fullDistTarTask,
slimDistTarTask,
slimDistTarTask
].each { dep ->
dependsOn dep
files += dep.outputs.files
}
dependsOn configurations.openApiSpecFile
files += configurations.openApiSpecFile

outputDir = file("${buildDir}/checksums")
}
Expand All @@ -93,11 +97,19 @@ task signSourceTgz(type: Sign) {
dependsOn tasks.assembleSourceTgz
sign tasks.assembleSourceTgz.destination
}
task signOpenApiSpec(type: Sign) {
dependsOn configurations.openApiSpecFile
// This is not an artifact, so we need to use "file" not "configuration" signing
doFirst {
sign configurations.openApiSpecFile.singleFile
}
}

task signReleaseArchives(type: Sync) {
from tasks.signFullBinaryTgz
from tasks.signSlimBinaryTgz
from tasks.signSourceTgz
from tasks.signOpenApiSpec

into "${buildDir}/signatures"
}
Expand Down Expand Up @@ -125,6 +137,10 @@ task assembleRelease(type: Sync) {
into "changes"
})

from(configurations.openApiSpecFile, {
into "openApi"
})

from(configurations.docker, {
include 'Dockerfile.official*'
into "docker"
Expand All @@ -139,11 +155,26 @@ task assembleRelease(type: Sync) {
from fullDistTarTask
from slimDistTarTask

from tasks.computeChecksums
from(tasks.computeChecksums, {
exclude { it.file.getName().contains("openapi") }
//excludes ["**/*openapi.json.sha512"]
})
from(tasks.computeChecksums, {
include { it.file.getName().contains("openapi") }
//includes ["**/*openapi.json.sha512"]
into "openApi"
})

// Conditionally, attach signatures of all the release archives.
if (project.ext.withSignedArtifacts) {
from tasks.signReleaseArchives
from(tasks.signReleaseArchives, {
exclude { it.file.getName().contains("openapi") }
})

from(tasks.signReleaseArchives, {
include { it.file.getName().contains("openapi") }
into "openApi"
})
}

into releaseDir
Expand Down