-
Notifications
You must be signed in to change notification settings - Fork 75
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
[WIP]Mechanism to push zip plugins. #167
Closed
+124
−7
Closed
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
36f02f6
Updated issue templates from .github. (#165)
dblock fe84636
Merge remote-tracking branch 'upstream/main'
prudhvigodithi 55ffa67
Adding better gradle project dir
prudhvigodithi 1b03814
Added info in readme file
prudhvigodithi f4a9b64
Added info in readme file
prudhvigodithi 4456464
Added info in readme file
prudhvigodithi 87270d4
Added info in readme file
prudhvigodithi d2acc48
fixed typo in readme file
prudhvigodithi d34c67c
test skip
prudhvigodithi 2093e24
test skip
prudhvigodithi c25906c
Merge branch 'opensearch-project:main' into main
prudhvigodithi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,4 +184,4 @@ afterEvaluate { | |
doLast { delete file("$buildDir/distributions/$archiveName") } | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
plugins { | ||
id 'maven-publish' | ||
} | ||
|
||
ext { | ||
isSnapshot = "true" == System.getProperty("build.snapshot", "true") | ||
opensearch_version = System.getProperty("opensearch.version", "2.0.0-alpha1-SNAPSHOT") | ||
buildVersionQualifier = System.getProperty("build.version_qualifier", "alpha1") | ||
// 2.0.0-alpha1-SNAPSHOT -> 2.0.0.0-alpha1-SNAPSHOT | ||
version_tokens = opensearch_version.tokenize('-') | ||
opensearch_build = version_tokens[0] + '.0' | ||
if (buildVersionQualifier) { | ||
opensearch_build += "-${buildVersionQualifier}" | ||
opensearch_build_nosnapshot = opensearch_build | ||
} | ||
if (isSnapshot) { | ||
opensearch_build += "-SNAPSHOT" | ||
} | ||
} | ||
|
||
|
||
allprojects { | ||
// Default to the apache license | ||
project.ext.licenseName = 'The Apache Software License, Version 2.0' | ||
project.ext.licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
publishing { | ||
repositories { | ||
maven { | ||
name = 'staging' | ||
url = "${rootProject.buildDir}/local-staging-repo" | ||
} | ||
} | ||
publications { | ||
// add license information to generated poms | ||
all { | ||
pom.withXml { XmlProvider xml -> | ||
Node node = xml.asNode() | ||
node.appendNode('inceptionYear', '2021') | ||
|
||
Node license = node.appendNode('licenses').appendNode('license') | ||
license.appendNode('name', project.licenseName) | ||
license.appendNode('url', project.licenseUrl) | ||
|
||
Node developer = node.appendNode('developers').appendNode('developer') | ||
developer.appendNode('name', 'OpenSearch') | ||
developer.appendNode('url', 'https://github.com/opensearch-project/job-scheduler') | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
def group = "org.opensearch.plugin" | ||
def pluginversion = opensearch_build | ||
def component = "opensearch-job-scheduler" | ||
def description = "OpenSearch Job Scheduler Zip" | ||
def zipFile = "${component}-${pluginversion}.zip" | ||
def zipArtifact = "${rootProject.buildDir}/distributions/${zipFile}" | ||
|
||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
//Add ext.publish = 'skip' to skip publishing skip to maven staging repo | ||
groupId = "${group}" | ||
artifactId = "${component}" | ||
version = "${pluginversion}" | ||
// Add extension, to get <packaging>zip</packaging> as in pom file | ||
artifact(zipArtifact) { | ||
extension 'zip' | ||
} | ||
pom { | ||
name = "${component}" | ||
description = "${description}" | ||
} | ||
} | ||
} | ||
} | ||
|
||
task printZipsPublishProperty { | ||
doLast { | ||
tasks.withType(PublishToMavenRepository).all { publishTask -> | ||
if (publication.hasProperty('publish')) { | ||
println(publication.publish) | ||
}else { | ||
println("null") | ||
} | ||
} | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
tasks.withType(PublishToMavenRepository).all { publishTask -> | ||
publishTask.onlyIf { task -> | ||
if (publication.hasProperty('publish') && publication.publish == 'skip') { | ||
return false | ||
} | ||
return true | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be job scheduler not security, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I have updated in my latest commit.