1+ import org.apache.tools.ant.filters.ReplaceTokens
2+
13buildscript {
24 repositories {
35 mavenCentral()
46 }
57}
8+
69plugins {
7- id ' pl.allegro.tech.build.axion-release' version ' 1.14.2'
10+ id ' base'
11+ id ' pl.allegro.tech.build.axion-release' version ' 1.17.2'
12+ id ' io.github.gradle-nexus.publish-plugin' version ' 2.0.0'
813}
914
15+ group = ' org.rundeck.plugins'
16+
1017ext. pluginName = ' kubernetes'
1118ext. pluginDescription = " Kubernetes Rundeck Plugin to manage pods , deployments, etc"
1219ext. sopsCopyright = " © 2018, Rundeck, Inc."
@@ -16,16 +23,91 @@ ext.archivesBaseName = "kubernetes"
1623ext. pluginBaseFolder = " ."
1724
1825scmVersion {
19- ignoreUncommittedChanges = true
26+ ignoreUncommittedChanges = false
2027 tag {
21- prefix = ' '
28+ prefix = ' ' // NO "v" prefix - see PLUGIN_TAGGING_ARCHITECTURE.md
2229 versionSeparator = ' '
23- def origDeserialize= deserialize
30+ }
31+ versionCreator ' simple' // Use simple version creator (just tag name)
32+ }
33+
34+ version = scmVersion. version // Dynamic version from git tag
35+ ext. publishName = " Kubernetes ${ project.version} "
36+ ext. githubSlug = ' rundeck-plugins/kubernetes'
37+ ext. developers = [
38+ [id : ' gschueler' , name : ' Greg Schueler' , email : ' greg@rundeck.com' ]
39+ ]
40+
41+ // ZIP plugin task - must use Jar type for proper manifest handling
42+ task pluginZip (type : Jar ) {
43+ archiveBaseName = archivesBaseName
44+ archiveVersion = version
45+ archiveClassifier = ' '
46+ archiveExtension = ' zip'
47+ destinationDirectory = layout. buildDirectory. dir(' libs' )
48+
49+ from(layout. buildDirectory. dir(' zip-contents' )) {
50+ include(' *.yaml' )
51+ include(' resources/**' )
52+ include(' contents/*' )
53+ into(" ${ archivesBaseName} -" + project. version. toString())
54+ }
55+
56+ manifest {
57+ attributes(
58+ ' Rundeck-Plugin-Name' : pluginName,
59+ ' Rundeck-Plugin-Description' : pluginDescription,
60+ ' Rundeck-Plugin-Archive' : ' true' ,
61+ ' Rundeck-Plugin-File-Version' : project. version. toString(),
62+ ' Rundeck-Plugin-Author' : sopsCopyright,
63+ ' Rundeck-Plugin-URL' : sopsUrl,
64+ ' Rundeck-Plugin-Date' : buildDateString
65+ )
66+ }
67+ }
68+
69+ pluginZip. doFirst {
70+ def assetsMap = new Properties ()
71+ def tokens = assetsMap + [
72+ version : project. version. toString(),
73+ date : buildDateString,
74+ author : sopsCopyright,
75+ url : sopsUrl,
76+ title : pluginName,
77+ description : pluginDescription,
78+ name : archivesBaseName,
79+ ]
80+
81+ copy {
82+ from(file(' resources' )) {
83+ include(' **/*' )
84+ into(' resources' )
85+ }
86+
87+ from(file(' contents' )) {
88+ into(' contents' )
89+ }
2490
91+ from(' plugin.yaml' ) {
92+ filter(ReplaceTokens , tokens : tokens)
93+ exclude(' **/*.png' )
94+ }
95+
96+ into(layout. buildDirectory. dir(' zip-contents' ))
2597 }
2698}
2799
28- project. version = scmVersion. version
29- ext. archiveFilename = ext. archivesBaseName + ' -' + version
100+ // Wire into build lifecycle
101+ assemble. dependsOn pluginZip
102+
103+ nexusPublishing {
104+ packageGroup = ' org.rundeck.plugins'
105+ repositories {
106+ sonatype {
107+ nexusUrl. set(uri(" https://ossrh-staging-api.central.sonatype.com/service/local/" ))
108+ snapshotRepositoryUrl. set(uri(" https://central.sonatype.com/repository/maven-snapshots/" ))
109+ }
110+ }
111+ }
30112
31- apply from : ' https://raw.githubusercontent.com/rundeck-plugins/build-zip/ gradle-5.6/build .gradle'
113+ apply from : " ${ rootDir } / gradle/publishing .gradle"
0 commit comments