forked from rundeck/plugin-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
90 lines (73 loc) · 2.37 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
plugins {
id 'groovy'
id 'application'
id "nebula.ospackage" version "4.8.0"
id 'pl.allegro.tech.build.axion-release' version '1.4.1'
id 'com.github.johnrengelman.shadow' version '2.0.3'
}
apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'nebula.ospackage'
mainClassName = 'com.rundeck.plugin.Generator'
applicationName = 'rundeck-plugin-bootstrap'
ext.distInstallPath = '/var/lib/rundeck-pb'
defaultTasks 'clean', 'build'
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.13'
compile 'com.github.rundeck.cli-toolbelt:toolbelt:0.2.2'
compile 'com.github.rundeck.cli-toolbelt:toolbelt-jewelcli:0.2.2'
compile 'org.apache.commons:commons-text:1.4'
compile 'info.picocli:picocli:4.0.0-alpha-2'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
}
repositories {
jcenter()
mavenLocal()
maven { url "https://jitpack.io" }
}
scmVersion {
ignoreUncommittedChanges = false
tag {
prefix = ''
versionSeparator = ''
}
}
allprojects {
project.version = scmVersion.version
ext.rpmVersion=project.version.replaceAll('-', '.')
}
//force distZip/distTar artifacts to be overwritten by shadow versions
shadowDistZip.mustRunAfter distZip
shadowDistTar.mustRunAfter distTar
/**
* Define rpm/deb details
*/
ospackage {
version = rpmVersion
release = 1
summary = "Bootstrap your Rundeck plugin development with this easy command line utility."
packageDescription = "The rundeck-plugin-bootstrap program provides an easy command line utility to create plugins for rundeck"
url = 'https://github.com/rundeck/plugin-bootstrap'
vendor = 'Rundeck, Inc.'
license = 'APL'
os = 'LINUX'
packageGroup = 'System'
user = 'root'
//packaging includes the shadowDistZip contents, exclude *.bat
from(zipTree(shadowDistZip.outputs.files.singleFile)) {
exclude '**/*.bat'
into distInstallPath
}
def archivedir=shadowDistZip.archiveName - ".${shadowDistZip.extension}"
//symlink /usr/bin/rd to the rd script
link("/usr/bin/${applicationName}", "${distInstallPath}/${archivedir}/bin/${applicationName}")
}
//depend on the shadow artifact
buildDeb.dependsOn shadowDistZip
buildRpm.dependsOn shadowDistZip
assemble.dependsOn buildRpm, buildDeb
wrapper {
gradleVersion = '4.7'
}