Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,23 @@ gradle-app.setting
# gradle/wrapper/gradle-wrapper.properties

# End of https://www.gitignore.io/api/java,gradle

# IDE and Editor files
.vscode/
.idea/
*.iml
*.swp
*.swo
*~

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Log files
*.log
114 changes: 94 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,40 +1,114 @@
buildscript {
repositories {
mavenCentral()
}
}
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
id 'pl.allegro.tech.build.axion-release' version '1.7.0'
id 'pl.allegro.tech.build.axion-release' version '1.18.6'
id 'maven-publish'
}

repositories {
mavenCentral()
}

// Set extension properties
ext.pluginName = 'puppet-apply-step'
ext.pluginDescription = "executes the puppet apply command on each node matching the Job node filter"
ext.sopsCopyright = "© 2017, Rundeck, Inc."
ext.sopsUrl = "http://rundeck.com"
ext.buildDateString=new Date().format("yyyy-MM-dd'T'HH:mm:ssX")
ext.sopsCopyright = "© 2025, Rundeck, Inc."
ext.sopsUrl = "https://rundeck.com"
ext.buildDateString = new Date().format("yyyy-MM-dd'T'HH:mm:ssX")
ext.archivesBaseName = "puppet-apply-step"
ext.pluginBaseFolder = "puppet-apply-step"


scmVersion {
ignoreUncommittedChanges = true
tag {
prefix = 'v'
versionSeparator = ''
def origDeserialize=deserialize
//apend .0 to satisfy semver if the tag version is only X.Y
deserialize = { config, position, tagName ->
def orig = origDeserialize(config, position, tagName)
if (orig.split('\\.').length < 3) {
orig += ".0"
}
}

project.version = scmVersion.version

task prepareZipContents {
doLast {
def assetsMap = new Properties()
def tokens = assetsMap + [
version : version,
date : new Date().toString(),
author : sopsCopyright,
url : sopsUrl,
title : pluginName,
description: pluginDescription,
name : archivesBaseName.toString(),
]

copy {
from("${project.projectDir}/puppet-apply-step/resources") {
include '**/*.png'
into "resources"
}

from("${project.projectDir}/puppet-apply-step/contents") {
into "contents"
}

from("${project.projectDir}/puppet-apply-step/plugin.yaml") {
filter(ReplaceTokens, tokens: tokens)
exclude '**/*.png'
}
orig

into "${project.buildDir}/zip-contents"
}
}
}

project.version = scmVersion.version
ext.archiveFilename = ext.archivesBaseName + '-v' + version
// Create the plugin zip task using modern Gradle syntax
task pluginZip(type: Jar) {
dependsOn 'prepareZipContents'
archiveBaseName = project.ext.archivesBaseName
archiveVersion = project.version
archiveClassifier = ''
archiveExtension = 'zip'
destinationDirectory = file("${buildDir}/libs")

from("${project.buildDir}/zip-contents") {
include("*.yaml")
include("resources/*")
include("contents/*")
into("${project.ext.archivesBaseName}-v${version}")
}

manifest {
attributes(
'Rundeck-Plugin-Name': pluginName.toString(),
'Rundeck-Plugin-Description': pluginDescription.toString(),
'Rundeck-Plugin-Archive': 'true',
'Rundeck-Plugin-File-Version': version,
'Rundeck-Plugin-Author': sopsCopyright,
'Rundeck-Plugin-URL': sopsUrl,
'Rundeck-Plugin-Date': buildDateString
)
}
}

publishing {
publications {
mavenZip(MavenPublication) {
artifact pluginZip
}
}
}

defaultTasks 'clean', 'build', 'pluginZip'

task build {
dependsOn 'pluginZip'
}

task install {
dependsOn 'build', 'publishToMavenLocal'
}

apply from: 'https://raw.githubusercontent.com/ltamaster/build-zip/master/build.gradle'
task clean(type: Delete) {
delete 'build'
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 4 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#Tue Jun 27 13:16:12 CLT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
Loading