Skip to content

Commit

Permalink
Merge pull request #1 from rundeck/rpmbuild
Browse files Browse the repository at this point in the history
add rpm/deb build artifacts with nebula gradle plugin
  • Loading branch information
gschueler authored Jun 9, 2016
2 parents d41d124 + 4cac5ee commit 4ae811f
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ deploy:
- 'build/distributions/rd-*.zip'
- 'build/distributions/rd-*.tar'
- 'build/libs/rundeck-cli-*-all.jar'
- 'build/distributesion/rundeck-cli*.rpm'
- 'build/distributesion/rundeck-cli*.deb'
on:
repo: rundeck/rundeck-cli
tags: true
Expand Down
51 changes: 46 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

plugins {
id 'pl.allegro.tech.build.axion-release' version '1.3.4'
id 'groovy'
id 'com.github.johnrengelman.shadow' version '1.2.3'
id "nebula.ospackage" version "3.6.1"
}

scmVersion {
Expand All @@ -20,9 +20,11 @@ apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'nebula.ospackage'

mainClassName = 'org.rundeck.client.tool.App'
applicationName = 'rd'
ext.distInstallPath = '/var/lib/rundeck/cli'
defaultTasks 'clean', 'build'

repositories {
Expand All @@ -36,11 +38,10 @@ dependencies {
compile 'com.squareup.retrofit2:converter-simplexml:2.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.0.1'
// compile 'com.lexicalscope.jewelcli:jewelcli:0.8.9'
compile project(':toolbelt')
compile project(':toolbelt-jewelcli')

testCompile group: 'junit', name:'junit', version: '4.12'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19'
testCompile "org.codehaus.groovy:groovy-all:2.3.7"
testCompile "org.spockframework:spock-core:0.7-groovy-2.0"
Expand All @@ -49,8 +50,48 @@ dependencies {
//force distZip/distTar artifacts to be overwritten by shadow versions
distShadowZip.mustRunAfter distZip
distShadowTar.mustRunAfter distTar
assemble.dependsOn distShadowZip,distShadowTar

/**
* remove illegal chars for snapshot rpm build
*/
def pkgVersion = {
project.version.replaceAll('-', '.')
}

/**
* Define rpm/deb details
*/
ospackage {
version = pkgVersion()
release = 1
summary = "A commandline tool for Rundeck."
packageDescription = "The rd program provides an all-in-one commandline tool to interact with Rundeck"
url = 'https://github.com/rundeck/rundeck-cli'
vendor = 'SimplifyOps, Inc.'
license = 'APL'
os = 'LINUX'
packageGroup = 'System'
user = 'root'

//packaging includes the distShadowZip contents, exclude *.bat
from(zipTree(distShadowZip.outputs.files.singleFile)) {
exclude '**/*.bat'
into distInstallPath
}

def archivedir=distShadowZip.archiveName - ".${distShadowZip.extension}"

//symlink /usr/bin/rd to the rd script
link("/usr/bin/${applicationName}", "${distInstallPath}/${archivedir}/bin/${applicationName}")
}


//depend on the shadow artifact
buildDeb.dependsOn distShadowZip
buildRpm.dependsOn distShadowZip

assemble.dependsOn buildRpm, buildDeb

task wrapper(type: Wrapper) {
gradleVersion = '2.11'
gradleVersion = '2.13'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Mar 28 11:35:01 PDT 2016
#Thu Jun 09 14:23:01 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
2 changes: 1 addition & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ echo location of your Java installation.
goto fail

:init
@rem Get command-line arguments, handling Windowz variants
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
Expand Down

0 comments on commit 4ae811f

Please sign in to comment.