-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathbuild.gradle
More file actions
113 lines (96 loc) · 3.17 KB
/
build.gradle
File metadata and controls
113 lines (96 loc) · 3.17 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'base'
id 'pl.allegro.tech.build.axion-release' version '1.17.2'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}
group = 'org.rundeck.plugins'
ext.pluginName = 'kubernetes'
ext.pluginDescription = "Kubernetes Rundeck Plugin to manage pods , deployments, etc"
ext.sopsCopyright = "© 2018, Rundeck, Inc."
ext.sopsUrl = "http://rundeck.com"
ext.buildDateString=new Date().format("yyyy-MM-dd'T'HH:mm:ssX")
ext.archivesBaseName = "kubernetes"
ext.pluginBaseFolder = "."
scmVersion {
ignoreUncommittedChanges = false
tag {
prefix = '' // NO "v" prefix - see PLUGIN_TAGGING_ARCHITECTURE.md
versionSeparator = ''
}
versionCreator 'simple' // Use simple version creator (just tag name)
}
version = scmVersion.version // Dynamic version from git tag
ext.publishName = "Kubernetes ${project.version}"
ext.githubSlug = 'rundeck-plugins/kubernetes'
ext.developers = [
[id: 'gschueler', name: 'Greg Schueler', email: 'greg@rundeck.com']
]
// ZIP plugin task - must use Jar type for proper manifest handling
task pluginZip(type: Jar) {
archiveBaseName = archivesBaseName
archiveVersion = version
archiveClassifier = ''
archiveExtension = 'zip'
destinationDirectory = layout.buildDirectory.dir('libs')
from(layout.buildDirectory.dir('zip-contents')) {
include('*.yaml')
include('resources/**')
include('contents/*')
into("${archivesBaseName}-" + project.version.toString())
}
manifest {
attributes(
'Rundeck-Plugin-Name': pluginName,
'Rundeck-Plugin-Description': pluginDescription,
'Rundeck-Plugin-Archive': 'true',
'Rundeck-Plugin-File-Version': project.version.toString(),
'Rundeck-Plugin-Author': sopsCopyright,
'Rundeck-Plugin-URL': sopsUrl,
'Rundeck-Plugin-Date': buildDateString
)
}
}
pluginZip.doFirst {
def assetsMap = new Properties()
def tokens = assetsMap + [
version : project.version.toString(),
date : buildDateString,
author : sopsCopyright,
url : sopsUrl,
title : pluginName,
description: pluginDescription,
name : archivesBaseName,
]
copy {
from(file('resources')) {
include('**/*')
into('resources')
}
from(file('contents')) {
into('contents')
}
from('plugin.yaml') {
filter(ReplaceTokens, tokens: tokens)
exclude('**/*.png')
}
into(layout.buildDirectory.dir('zip-contents'))
}
}
// Wire into build lifecycle
assemble.dependsOn pluginZip
nexusPublishing {
packageGroup = 'org.rundeck.plugins'
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}
apply from: "${rootDir}/gradle/publishing.gradle"