diff --git a/.travis.yml b/.travis.yml index 6fe6cfd2..2e3e2290 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,9 +46,9 @@ deploy: file_glob: true skip_cleanup: true after_deploy: -- ./gradlew -p rd-cli-tool -PbintrayUser=gschueler -PbintrayUserOrg=rundeck -PbintrayRepo=rundeck-rpm -Pcomponent=rpm bintrayUpload -- ./gradlew -p rd-cli-tool -PbintrayUser=gschueler -PbintrayUserOrg=rundeck -PbintrayRepo=rundeck-deb -Pcomponent=deb bintrayUpload -- ./gradlew -p rd-api-client -PbintrayUser=gschueler -PbintrayUserOrg=rundeck -PbintrayRepo=rundeck-maven bintrayUpload +- ./gradlew -PbintrayUser=gschueler -PbintrayUserOrg=rundeck -PbintrayRepo=rundeck-rpm -Pcomponent=rpm bintrayUpload +- ./gradlew -PbintrayUser=gschueler -PbintrayUserOrg=rundeck -PbintrayRepo=rundeck-deb -Pcomponent=deb bintrayUpload +- ./gradlew -PbintrayUser=gschueler -PbintrayUserOrg=rundeck -PbintrayRepo=rundeck-maven -Pcomponent=api bintrayUpload env: global: - secure: 2LDWRCZsuUYNUNHQz4oiaq9VIcdp0ziI7SKBxUxfqT4rehJ0J7kz+UPqwtgxMiUyQaHJQqzkcR+m6H3VZj9BREY+POiyu+yJOqhe3KRpDAfiN/gnwN81Nh9wloVaxyVe6i5yPaaBvE5vIREi7SAUdDtdsQ6WSkQ3JnaSL5Nz6e3DKR6+wgaTmBhh/TTW1YuN1qo5EjBpm0//M+KwY5BvVYOfPYLHCpVqnWFePQBkZY13lvufC5XPipXMf6c5Un/Uy6oVaRgLSPHDyELQvBzMSRPtzNmJSDm75LvclHHgDYEUcrcxRoWgAEISaBeIpGhe/PnsswCtQMfQBIm0W8Cv+HThbdCrrTdz/hWsohVvLFkCl9L8NOTOnATr2I9F0GBmsdhJvvr10JqGGol8Y9wwu5eiO9AWmchjZPicIWj5Dwo9E8AdT20aX4l287StESedS/Wtqh7gdf4d3Y1svWLEmh3gbERqOI9hRDV0DotfumhaW49SbaN/XecODiyPrnLBONSrYk1bWADDAvBZm/Jy0hvFbaVFFI8HfZMVJCO4GJJwna2MEMnsouNl2eDBFtvX5JHQ00JP4QacPFwW3/0NsgdaUGLiPSNezNJ1kBYtVbhQg4oL3yTkFaU6KuGhJcdSCVJUwOeP0YZF0oklofLhEhc4puzAi6EmGvLpMeh/huw= diff --git a/gradle/bintray.gradle b/gradle/bintray.gradle deleted file mode 100644 index 3a780c5b..00000000 --- a/gradle/bintray.gradle +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2017 Rundeck, Inc. (http://rundeck.com) - * - * Licensed 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. - */ - - -def bintrayUser = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') -def bintrayKey = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : - System.getenv('BINTRAY_API_KEY') -def bintrayUserOrg = project.hasProperty('bintrayUserOrg') ? project.property('bintrayUserOrg') : - System.getenv('BINTRAY_USER_ORG') -def bintrayRepo = project.hasProperty('bintrayRepo') ? project.property('bintrayRepo') : - System.getenv('BINTRAY_REPO') - -// -//def bintrayPassphrase = project.hasProperty('bintray.gpg.password') ? project.property('bintray.gpg.password') : -// System.getenv('BINTRAY_GPG_PASSWORD') - -if (bintrayUser && bintrayKey && bintrayRepo) { - - def components = [ - rpm: [pat: '*.rpm'], - deb: [pat: '*.deb'], - ] - - def component = ( - project.hasProperty('component') ? project.property('component') : - System.getenv('BINTRAY_UPLOAD_COMPONENT') - ) - if (!component || !components.containsKey(component)) { - throw new Exception( - "Component for upload not specified or invalid (${component}). Use gradle property -Pcomponent or env var BINTRAY_UPLOAD_COMPONENT.\n" + - "Valid values: ${components.keySet()}" - ) - } - - apply plugin: 'com.jfrog.bintray' - bintray { - user = bintrayUser - key = bintrayKey - - filesSpec { - from("$buildDir/distributions") { - include components[component].pat - } - - into "." - } - - dryRun = false - publish = true - override = true - pkg { - name = 'rundeck-cli' - repo = bintrayRepo - if(bintrayUserOrg) { - userOrg = bintrayUserOrg - } - licenses = ['Apache-2.0'] - vcsUrl = 'https://github.com/rundeck/rundeck-cli.git' - websiteUrl = 'https://github.com/rundeck/rundeck-cli' - issueTrackerUrl = 'https://github.com/rundeck/rundeck-cli/issues' - githubRepo = 'rundeck/rundeck-cli' //Optional Github repository - githubReleaseNotesFile = 'README.md' //Optional Github readme file - if(component=='deb'){ - debian { - distribution = 'any' - component = 'main' - architecture = 'noarch' - } - } - version { - name = rpmVersion - desc = "Rundeck CLI Tools ${rpmVersion}" - vcsTag = "v${rpmVersion}" - } - } - } -} diff --git a/rd-api-client/build.gradle b/rd-api-client/build.gradle index f2662727..a32c6cc0 100644 --- a/rd-api-client/build.gradle +++ b/rd-api-client/build.gradle @@ -132,7 +132,11 @@ def bintrayUserOrg = project.hasProperty('bintrayUserOrg') ? project.property('b def bintrayRepo = project.hasProperty('bintrayRepo') ? project.property('bintrayRepo') : System.getenv('BINTRAY_REPO') -if (bintrayUser && bintrayKey && bintrayRepo) { +def component = ( + project.hasProperty('component') ? project.property('component') : + System.getenv('BINTRAY_UPLOAD_COMPONENT') +) +if (component && ['api'].contains(component) && bintrayUser && bintrayKey && bintrayRepo) { apply plugin: 'com.jfrog.bintray' bintray { diff --git a/rd-cli-tool/build.gradle b/rd-cli-tool/build.gradle index 20ed35a4..02d8010f 100644 --- a/rd-cli-tool/build.gradle +++ b/rd-cli-tool/build.gradle @@ -179,4 +179,73 @@ buildRpm.dependsOn shadowDistZip assemble.dependsOn buildRpm, buildDeb -apply from: '../gradle/bintray.gradle' +def bintrayUser = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') +def bintrayKey = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : + System.getenv('BINTRAY_API_KEY') +def bintrayUserOrg = project.hasProperty('bintrayUserOrg') ? project.property('bintrayUserOrg') : + System.getenv('BINTRAY_USER_ORG') +def bintrayRepo = project.hasProperty('bintrayRepo') ? project.property('bintrayRepo') : + System.getenv('BINTRAY_REPO') + +def component = ( + project.hasProperty('component') ? project.property('component') : + System.getenv('BINTRAY_UPLOAD_COMPONENT') +) +if (component && ['rpm','deb'].contains(component) && bintrayUser && bintrayKey && bintrayRepo) { + + def components = [ + rpm: [pat: '*.rpm'], + deb: [pat: '*.deb'], + ] + + if (!component || !components.containsKey(component)) { + throw new Exception( + "Component for upload not specified or invalid (${component}). Use gradle property -Pcomponent or env var BINTRAY_UPLOAD_COMPONENT.\n" + + "Valid values: ${components.keySet()}" + ) + } + + apply plugin: 'com.jfrog.bintray' + bintray { + user = bintrayUser + key = bintrayKey + + filesSpec { + from("$buildDir/distributions") { + include components[component].pat + } + + into "." + } + + dryRun = false + publish = true + override = true + pkg { + name = 'rundeck-cli' + repo = bintrayRepo + if(bintrayUserOrg) { + userOrg = bintrayUserOrg + } + licenses = ['Apache-2.0'] + vcsUrl = 'https://github.com/rundeck/rundeck-cli.git' + websiteUrl = 'https://github.com/rundeck/rundeck-cli' + issueTrackerUrl = 'https://github.com/rundeck/rundeck-cli/issues' + githubRepo = 'rundeck/rundeck-cli' //Optional Github repository + githubReleaseNotesFile = 'README.md' //Optional Github readme file + if(component=='deb'){ + debian { + distribution = 'any' + component = 'main' + architecture = 'noarch' + } + } + version { + name = rpmVersion + desc = "Rundeck CLI Tools ${rpmVersion}" + vcsTag = "v${rpmVersion}" + } + } + } +} +