Skip to content

Commit c3ff691

Browse files
authored
Merge origin/main into grails7-upgrade, resolving conflicts
2 parents 2428a84 + 1760e47 commit c3ff691

13 files changed

Lines changed: 480 additions & 73 deletions

File tree

.github/copilot-instructions.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!-- AUTO-GENERATED from rundeck-plugins/.github/templates/copilot-instructions.shared.md -- DO NOT EDIT. Run scripts/sync-copilot-instructions.sh to update. -->
2+
3+
# GitHub Copilot Instructions
4+
5+
This repository is part of the `rundeck-plugins` organization and follows the org-wide engineering guide.
6+
7+
- Canonical guide: https://github.com/rundeck-plugins/.github/blob/main/CLAUDE.md
8+
- Plugin overview: https://github.com/rundeck-plugins/.github/blob/main/PLUGINS_OVERVIEW.md
9+
10+
Read the canonical guide for the full context. The essentials below apply to work in this repo.
11+
12+
## Working agreements
13+
- Optimize for customer impact first; connect technical choices to customer/business impact.
14+
- Strive for backwards compatibility. Announce deprecations; don't remove until the next major version.
15+
- Do not push to GitHub or create commits unless explicitly asked.
16+
- Never add `Co-authored-by` / agent / Cursor trailers or email author flags to commits. Plain messages describing the change only.
17+
- Commit messages and PR descriptions explain the "why" and the customer impact, not just the "what."
18+
- Avoid emojis unless explicitly requested.
19+
- Write full build logs to a `temp/` dir at the repo root using `YYYYMMDD-HHMMSS-<desc>.log` names; re-read logs instead of re-running builds repeatedly.
20+
21+
## Build and release conventions
22+
- Baseline: Rundeck 6.0 (Grails 7 / Spring Boot 3). JAR plugins build on Java 17.
23+
- Maven coordinates: group `com.rundeck.plugins`, published to PackageCloud (`PKGCLD_READ_TOKEN`).
24+
- Versioning: Axion from git tags with `prefix = ''` (tags like `1.2.3`, no `v`).
25+
- ZIP (script) plugins: package with Gradle `type: Jar` (archiveExtension `zip`), publish with `extension = 'jar'` and `pom.packaging = 'jar'`, and process `plugin.yaml` with `ReplaceTokens` (never `expand`).
26+
- Groovy-based JAR plugins need the `groovy` Gradle plugin and `groovy-all` dependency or the jar ships with no compiled classes.
27+
28+
## Branch and CI conventions
29+
- Default branch is `main`. Target CI triggers at `main`.
30+
- Security scanning is centralized: `.github/workflows/snyk-scan.yml` calls the org reusable Snyk workflow (push/PR to `main`, weekly Monday 06:00 UTC, and manual dispatch).

.github/workflows/gradle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v5
1212
with:
1313
fetch-depth: 0
1414
- name: Get Fetch Tags
1515
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
1616
if: "!contains(github.ref, 'refs/tags')"
1717
- name: Set up JDK 17
18-
uses: actions/setup-java@v4
18+
uses: actions/setup-java@v5
1919
with:
2020
java-version: 17
2121
distribution: 'zulu'
@@ -58,7 +58,7 @@ jobs:
5858
id: get_version
5959
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
6060
- name: Upload plugin jar
61-
uses: actions/upload-artifact@v4
61+
uses: actions/upload-artifact@v5
6262
with:
6363
# Artifact name
6464
name: Grails-Plugin-${{ steps.get_version.outputs.VERSION }}

.github/workflows/release.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
on:
22
push:
3-
# Sequence of patterns matched against refs/tags
43
tags:
5-
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
4+
- '*.*.*'
65

7-
name: Upload Release Asset
6+
name: Publish Release
87

98
jobs:
109
build:
11-
name: Upload Release Asset
10+
name: Publish Release
1211
runs-on: ubuntu-latest
1312
steps:
1413
- name: Checkout code
15-
uses: actions/checkout@v4
14+
uses: actions/checkout@v5
1615
with:
1716
fetch-depth: 0
1817
- name: Set up JDK 17
19-
uses: actions/setup-java@v4
18+
uses: actions/setup-java@v5
2019
with:
2120
java-version: '17'
2221
distribution: 'zulu'
@@ -25,8 +24,7 @@ jobs:
2524
- name: Get Release Version
2625
id: get_version
2726
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
28-
- name: Create Release and Upload Asset
29-
id: create_release
27+
- name: Create Release
3028
run: |
3129
gh release create \
3230
--generate-notes \
@@ -35,3 +33,10 @@ jobs:
3533
build/libs/ansible-plugin-${{ steps.get_version.outputs.VERSION }}.jar
3634
env:
3735
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Publish to Maven Central
37+
run: ./gradlew -PsigningKey=${SIGNING_KEY_B64} -PsigningPassword=${SIGNING_PASSWORD} -PsonatypeUsername=${SONATYPE_USERNAME} -PsonatypePassword=${SONATYPE_PASSWORD} publishToSonatype closeAndReleaseSonatypeStagingRepository
38+
env:
39+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
40+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
41+
SIGNING_KEY_B64: ${{ secrets.SIGNING_KEY_B64 }}
42+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}

.github/workflows/snyk-scan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches: [ main, master ]
66
pull_request:
77
branches: [ main, master ]
8+
schedule:
9+
# Weekly on Monday 06:00 UTC (GitHub Actions cron is UTC-only)
10+
- cron: '0 6 * * 1'
811
workflow_dispatch:
912

1013
jobs:

build.gradle

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
plugins {
2-
id 'pl.allegro.tech.build.axion-release' version '1.17.2'
3-
id 'maven-publish'
2+
id 'pl.allegro.tech.build.axion-release' version '1.21.2'
3+
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
44
}
55

6-
group = 'com.rundeck.plugins'
6+
group = 'org.rundeck.plugins'
7+
8+
ext.publishName = "Ansible Integration ${project.version}"
9+
ext.githubSlug = 'rundeck-plugins/ansible-plugin'
10+
ext.developers = [
11+
[id: 'rundeck', name: 'Rundeck Engineering', email: 'product@rundeck.com']
12+
]
713

814
ext.rundeckPluginVersion = '1.2'
915
ext.pluginClassNames = [
@@ -21,15 +27,28 @@ ext.pluginClassNames = [
2127

2228
apply plugin: 'java'
2329
apply plugin: 'groovy'
24-
sourceCompatibility = 17
25-
targetCompatibility = 17
30+
31+
// Maven Central (Sonatype) requires -sources.jar and -javadoc.jar on close; same as attribute-match java.gradle
32+
java {
33+
sourceCompatibility = JavaVersion.VERSION_17
34+
targetCompatibility = JavaVersion.VERSION_17
35+
withSourcesJar()
36+
withJavadocJar()
37+
}
38+
39+
// Lombok @Builder inner types break strict javadoc; Central still requires a -javadoc.jar artifact
40+
tasks.withType(Javadoc).configureEach {
41+
failOnError = false
42+
options.encoding = 'UTF-8'
43+
}
2644

2745
scmVersion {
2846
ignoreUncommittedChanges = false
2947
tag {
3048
prefix = '' // NO "v" prefix - see PLUGIN_TAGGING_ARCHITECTURE.md
3149
versionSeparator = ''
3250
}
51+
versionCreator 'simple' // Use simple version creator (just tag name); tolerates legacy v* tags
3352
}
3453

3554
version = scmVersion.version // Dynamic version from git tag
@@ -58,12 +77,12 @@ repositories {
5877
configurations {
5978
pluginLibs
6079

61-
// Security: Force resolution of vulnerable dependencies
80+
// Security: Force resolution of vulnerable dependencies (versions: gradle/libs.versions.toml)
6281
all {
6382
resolutionStrategy {
64-
force 'org.apache.commons:commons-lang3:3.20.0'
65-
force 'org.apache.commons:commons-compress:1.28.0'
66-
force 'org.jetbrains.kotlin:kotlin-stdlib:2.1.0'
83+
force libs.commons.lang3.get()
84+
force libs.commons.compress.get()
85+
force libs.kotlin.stdlib.get()
6786
// Exclude old commons-lang to prevent conflicts
6887
exclude group: 'commons-lang', module: 'commons-lang'
6988
}
@@ -76,7 +95,9 @@ configurations {
7695

7796
dependencies {
7897
pluginLibs libs.gson
79-
implementation libs.rundeck.core
98+
// rundeck-core: compileOnly so SNAPSHOT is not in published POM; testImplementation for tests
99+
compileOnly libs.rundeck.core
100+
testImplementation libs.rundeck.core
80101
implementation libs.groovy.all
81102
pluginLibs libs.jackson.core
82103
pluginLibs libs.jackson.dataformat.yaml
@@ -123,7 +144,7 @@ jar {
123144
def libList = configurations.pluginLibs.collect{'lib/' + it.name}.join(' ')
124145
attributes 'Rundeck-Plugin-Name' : 'Ansible Integration'
125146
attributes 'Rundeck-Plugin-Description' : 'This plugin brings basic Ansible support to Rundeck. It imports hosts from Ansible\'s inventory, including a bunch of facts, and can run modules and playbooks. There is also a node executor and file copier for your project.'
126-
attributes 'Rundeck-Plugin-Rundeck-Compatibility-Version': '3.0.1+'
147+
attributes 'Rundeck-Plugin-Rundeck-Compatibility-Version': '6.0.0+'
127148
attributes 'Rundeck-Plugin-Tags': 'java,node executor,resource model,workflow step,ansible'
128149
attributes 'Rundeck-Plugin-License': 'MIT'
129150
attributes 'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins/ansible-plugin'
@@ -139,27 +160,14 @@ jar {
139160
dependsOn(copyToLib)
140161
}
141162

142-
publishing {
143-
publications {
144-
maven(MavenPublication) {
145-
groupId = 'com.rundeck.plugins'
146-
artifactId = 'ansible-plugin'
147-
version = project.version
148-
from components.java
149-
}
150-
}
151-
163+
nexusPublishing {
164+
packageGroup = 'org.rundeck.plugins'
152165
repositories {
153-
maven {
154-
name = "PackageCloudTest"
155-
url = uri("https://packagecloud.io/pagerduty/rundeckpro-test/maven2")
156-
authentication {
157-
header(HttpHeaderAuthentication)
158-
}
159-
credentials(HttpHeaderCredentials) {
160-
name = "Authorization"
161-
value = "Bearer " + (System.getenv("PKGCLD_WRITE_TOKEN") ?: project.findProperty("pkgcldWriteToken"))
162-
}
166+
sonatype {
167+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
168+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
163169
}
164170
}
165171
}
172+
173+
apply from: "${rootDir}/gradle/publishing.gradle"

functional-test/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ repositories {
1111
group = 'com.github.rundeck-plugins'
1212

1313
configurations {
14-
// Security: Force resolution of vulnerable dependencies
14+
// Security: Force resolution (versions: root gradle/libs.versions.toml)
1515
all {
1616
resolutionStrategy {
17-
force 'org.apache.commons:commons-compress:1.28.0'
18-
force 'org.jetbrains.kotlin:kotlin-stdlib:2.1.0'
17+
force libs.commons.compress.get()
18+
force libs.kotlin.stdlib.get()
1919
}
2020
}
2121
}

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[versions]
22
# Security-fixed versions
3-
commons-lang3 = "3.17.0"
3+
commons-lang3 = "3.20.0"
44
commons-compress = "1.28.0"
55
kotlin-stdlib = "2.1.0"
66

77
# Current dependency versions (maintained for compatibility)
88
gson = "2.10.1"
9-
jackson = "2.21.2"
9+
jackson = "2.22.0"
1010
snakeyaml = "2.2"
1111
groovy = "4.0.29"
1212
lombok = "1.18.30"
1313
spock = "2.4-groovy-4.0"
1414
testcontainers = "1.19.0"
15-
rd-api-client = "2.0.9"
15+
rd-api-client = "2.1.2"
1616
jsch = "0.1.55"
1717
bytebuddy = "1.14.11"
1818
objenesis = "3.4"

gradle/publishing.gradle

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/**
2+
* Define project extension values in the project gradle file before including this file:
3+
*
4+
* publishName = 'Name of Package'
5+
* publishDescription = 'description' (optional)
6+
* githubSlug = Github slug e.g. 'rundeck/rundeck-cli'
7+
* developers = [ [id:'id', name:'name', email: 'email' ] ] list of developers
8+
*
9+
* Define project properties to sign and publish when invoking publish task:
10+
*
11+
* ./gradlew \
12+
* -PsigningKey="base64 encoded gpg key" \
13+
* -PsigningPassword="password for key" \
14+
* -PsonatypeUsername="sonatype token user" \
15+
* -PsonatypePassword="sonatype token password" \
16+
* publishToSonatype closeAndReleaseSonatypeStagingRepository
17+
*/
18+
apply plugin: 'maven-publish'
19+
apply plugin: 'signing'
20+
21+
publishing {
22+
publications {
23+
"${project.name}"(MavenPublication) { publication ->
24+
from components.java
25+
26+
pom {
27+
name = publishName
28+
description = project.ext.hasProperty('publishDescription') ? project.ext.publishDescription :
29+
project.description ?: publishName
30+
url = "https://github.com/${githubSlug}"
31+
licenses {
32+
license {
33+
name = 'The Apache Software License, Version 2.0'
34+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
35+
distribution = 'repo'
36+
}
37+
}
38+
scm {
39+
url = "https://github.com/${githubSlug}"
40+
connection = "scm:git:git@github.com/${githubSlug}.git"
41+
developerConnection = "scm:git:git@github.com:${githubSlug}.git"
42+
}
43+
if (project.ext.developers) {
44+
developers {
45+
project.ext.developers.each { dev ->
46+
developer {
47+
id = dev.id
48+
name = dev.name
49+
email = dev.email
50+
}
51+
}
52+
}
53+
}
54+
}
55+
56+
}
57+
}
58+
repositories {
59+
def pkgcldWriteToken = System.getenv("PKGCLD_WRITE_TOKEN") ?: project.findProperty("pkgcldWriteToken")
60+
if (pkgcldWriteToken) {
61+
maven {
62+
name = "PackageCloudTest"
63+
url = uri("https://packagecloud.io/pagerduty/rundeckpro-test/maven2")
64+
authentication {
65+
header(HttpHeaderAuthentication)
66+
}
67+
credentials(HttpHeaderCredentials) {
68+
name = "Authorization"
69+
value = "Bearer " + pkgcldWriteToken
70+
}
71+
}
72+
}
73+
}
74+
}
75+
def base64Decode = { String prop ->
76+
project.findProperty(prop) ?
77+
new String(Base64.getDecoder().decode(project.findProperty(prop).toString())).trim() :
78+
null
79+
}
80+
81+
if (project.hasProperty('signingKey') && project.hasProperty('signingPassword')) {
82+
signing {
83+
useInMemoryPgpKeys(base64Decode("signingKey"), project.signingPassword)
84+
sign(publishing.publications)
85+
}
86+
}

jitpack.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)