-
Notifications
You must be signed in to change notification settings - Fork 197
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
Publish to multiple repositories? #84
Comments
I have the same use case (a jar module is also packaged as an application and then a deb file using the gradle-ospackage-plugin). The jar should go to a maven repo and the deb to a debian repo Currently doing some dirty groovy |
Ended up not going the Seems like it could be solved in a cleaner way supporting multiple Here's what I did (as a plugin for our project): class OspackageBintrayPublishPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
project.plugins.apply(BintrayPlugin)
//OspackageBintrayExtension just has one attribute (packageRepo):
def packageExtension = project.extensions.create('bintrayPackage', OspackageBintrayExtension)
project.tasks.withType(Deb) { Deb deb ->
def spinnakerDebians = project.configurations.maybeCreate('debians')
project.artifacts.add('debians', deb)
def extension = (BintrayExtension) project.extensions.getByName('bintray')
//this is all copy-n-pasteware from BintrayPlugin except the setting of repoName
def buildDebPublish = project.tasks.create("publish${deb.name}", BintrayUploadTask) { BintrayUploadTask task ->
task.with {
apiUrl = extension.apiUrl
user = extension.user
apiKey = extension.key
configurations = ['debians']
publish = extension.publish
dryRun = extension.dryRun
userOrg = extension.pkg.userOrg ?: extension.user
repoName = packageExtension.packageRepo ?: extension.pkg.repo
packageName = extension.pkg.name
packageDesc = extension.pkg.desc
packageWebsiteUrl = extension.pkg.websiteUrl
packageIssueTrackerUrl = extension.pkg.issueTrackerUrl
packageVcsUrl = extension.pkg.vcsUrl
packageLicenses = extension.pkg.licenses
packageLabels = extension.pkg.labels
packageAttributes = extension.pkg.attributes
packagePublicDownloadNumbers = extension.pkg.publicDownloadNumbers
versionName = extension.pkg.version.name ?: project.version
versionDesc = extension.pkg.version.desc
versionReleased = extension.pkg.version.released
versionVcsTag = extension.pkg.version.vcsTag ?: project.version
versionAttributes = extension.pkg.version.attributes
signVersion = extension.pkg.version.gpg.sign
gpgPassphrase = extension.pkg.version.gpg.passphrase
syncToMavenCentral = extension.pkg.version.mavenCentralSync.sync == null ?
true : extension.pkg.version.mavenCentralSync.sync
ossUser = extension.pkg.version.mavenCentralSync.user
ossPassword = extension.pkg.version.mavenCentralSync.password
ossCloseRepo = extension.pkg.version.mavenCentralSync.close
}
}
buildDebPublish.dependsOn(deb)
buildDebPublish.dependsOn(debians.allArtifacts)
Upload installTask = project.tasks.withType(Upload)?.findByName('install')
if (installTask) {
buildDebPublish.dependsOn(installTask)
}
buildDebPublish.group = BintrayUploadTask.GROUP
project.tasks.publish.dependsOn(buildDebPublish)
}
}
} |
I have the exact same use-case as @sebersole; I need to publish the output of a Maven publication to a Maven repo and the output of the Gradle |
Sorry, I gave up trying to publish to bintray because of this. So no On Tue, Feb 23, 2016, 3:53 PM Douglas Stephen [email protected]
|
Adding the capability to publish files to multiple Bintray repositories is on our road-map. Thanks, |
For what it's worth, I seem to have the problem just with uploading to a On Wed, Feb 24, 2016, 2:06 AM Itamar Berman-Eshel [email protected]
|
@sebersole, @dljsjr and @cfieber, |
Thanks for the work. But as far as I know I am still unable to publish my release bundles (tgz/zip) using this plugin (Generic repo), which is really what I need - see my comment above. This one was a nice to have. |
I'm publishing zips and tarballs to a generic repo without problems! Olle Hallin 2016-06-22 17:26 GMT+02:00 Steve Ebersole [email protected]:
|
I will try once again with 1.7 |
Still getting error:
|
Tto be clear, that is with 1.7 and Gradle 3m1 |
This is my config:
My version is created: https://bintray.com/hibernate/bundles/hibernate-orm/5.2.1.test But no files get uploaded...
|
So what I have seem to have found is that filesSpec does not seem to work, at least for me. I changed that to use configurations instead and it started working. The plugin documentation I think is maybe just wrong or unclear. |
And any idea what this might mean? "Configuration(s) specified but the install task does not exist in project :release." |
Still struggling getting this plugin to work :) So here is where I am at. I have the following:
For testing I switched my local project version to As I understand it, that This plugin uploads the 2 5.2.1.test archives. But it eventually fails with:
I have no idea where this plugin/task is getting 5.2.1-SNAPSHOT. |
Strangely it just started working. I swear I did not make any changes :) Anyway, I am currently not publishing the Maven artifacts to Bintray so I can not comment on the plugin working to publish to 2 BinTray repos simultaneously. But it does now seem to be working (albeit in a touchy way) to publish to a generic repo, which I was not able to do previously - I did have to change to use configurations rather than filesSpec to get it to work though. |
Perhaps I am just missing something in the README, and if so please feel free to point me there..
I have a multi-module build (Hibernate) where I need to be able to publish to 2 separate repositories:
But I am completely unsure how to set up this up in the extension.
The text was updated successfully, but these errors were encountered: