Skip to content

Commit 191dd44

Browse files
authored
Merge pull request #427 from rundeck-plugins/grails7-upgrade
Grails 7 Migration - Rundeck 6.0 Compatibility
2 parents 23cdf4b + 93e403f commit 191dd44

9 files changed

Lines changed: 94 additions & 76 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,34 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
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')"
17-
- name: Set up JDK 1.11
18-
uses: actions/setup-java@v1
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
1919
with:
20-
java-version: 11
20+
java-version: 17
21+
distribution: 'zulu'
2122
- name: Grant execute permission for gradlew
2223
run: chmod +x gradlew
2324
- name: Build with Gradle
2425
run: ./gradlew build
2526
- name: Copy Artifact for integration test
2627
run: ./gradlew :functional-test:copyPluginArtifact
28+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
2729
- name: Run integration Test
2830
run: ./gradlew :functional-test:functionalTest
31+
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
2932
- name: Get Release Version
3033
id: get_version
31-
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
34+
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
3235
- name: Upload plugin jar
3336
uses: actions/upload-artifact@v4
3437
with:
3538
# Artifact name
3639
name: Grails-Plugin-${{ steps.get_version.outputs.VERSION }}
3740
# Directory containing files to upload
38-
path: build/libs/ansible-plugin-${{ steps.get_version.outputs.VERSION }}.jar
41+
path: build/libs/ansible-plugin-${{ steps.get_version.outputs.VERSION }}.jar

.github/workflows/release.yml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,26 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
18-
- name: set up JDK 1.11
19-
uses: actions/setup-java@v1
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
2020
with:
21-
java-version: 11
21+
java-version: '17'
22+
distribution: 'zulu'
2223
- name: Build with Gradle
2324
run: ./gradlew build
2425
- name: Get Release Version
2526
id: get_version
26-
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
27-
- name: Create Release
27+
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
28+
- name: Create Release and Upload Asset
2829
id: create_release
29-
uses: actions/create-release@v1.0.0
30+
run: |
31+
gh release create \
32+
--generate-notes \
33+
--title 'Release ${{ steps.get_version.outputs.VERSION }}' \
34+
${{ github.ref_name }} \
35+
build/libs/ansible-plugin-${{ steps.get_version.outputs.VERSION }}.jar
3036
env:
3137
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
with:
33-
tag_name: ${{ github.ref }}
34-
release_name: Release ${{ steps.get_version.outputs.VERSION }}
35-
draft: false
36-
prerelease: false
37-
- name: Upload Release Asset (jar)
38-
id: upload-release-asset
39-
uses: actions/upload-release-asset@v1
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
with:
43-
upload_url: ${{ steps.create_release.outputs.upload_url }}
44-
asset_path: build/libs/ansible-plugin-${{ steps.get_version.outputs.VERSION }}.jar
45-
asset_name: ansible-plugin-${{ steps.get_version.outputs.VERSION }}.jar
46-
asset_content_type: application/octet-stream

build.gradle

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
id 'maven-publish'
44
}
55

6-
group = 'com.github.rundeck-plugins'
6+
group = 'com.rundeck.plugins'
77

88
ext.rundeckPluginVersion = '1.2'
99
ext.pluginClassNames = [
@@ -21,21 +21,38 @@ ext.pluginClassNames = [
2121

2222
apply plugin: 'java'
2323
apply plugin: 'groovy'
24-
sourceCompatibility = 1.11
24+
sourceCompatibility = 17
25+
targetCompatibility = 17
2526

2627
scmVersion {
2728
ignoreUncommittedChanges = false
2829
tag {
29-
prefix = 'v'
30+
prefix = '' // NO "v" prefix - see PLUGIN_TAGGING_ARCHITECTURE.md
3031
versionSeparator = ''
3132
}
3233
}
3334

34-
version = scmVersion.version
35+
version = scmVersion.version // Dynamic version from git tag
3536

3637
repositories {
37-
mavenCentral()
3838
mavenLocal()
39+
maven {
40+
name = 'Central Portal Snapshots'
41+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
42+
content {
43+
includeGroup('org.rundeck')
44+
}
45+
} // Must be FIRST for Grails 7 development
46+
maven {
47+
name = 'Central Portal Snapshots'
48+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
49+
50+
// Only search this repository for org.rundeck snapshots
51+
content {
52+
includeGroup('org.rundeck')
53+
}
54+
}
55+
mavenCentral()
3956
}
4057

4158
configurations {
@@ -44,7 +61,7 @@ configurations {
4461
// Security: Force resolution of vulnerable dependencies
4562
all {
4663
resolutionStrategy {
47-
force 'org.apache.commons:commons-lang3:3.18.0'
64+
force 'org.apache.commons:commons-lang3:3.20.0'
4865
force 'org.apache.commons:commons-compress:1.28.0'
4966
force 'org.jetbrains.kotlin:kotlin-stdlib:2.1.0'
5067
// Exclude old commons-lang to prevent conflicts
@@ -77,11 +94,22 @@ dependencies {
7794
testAnnotationProcessor libs.lombok
7895

7996
testImplementation libs.spock.core
97+
testImplementation libs.bytebuddy
98+
testImplementation libs.objenesis
8099

81100
}
82101

83102
tasks.withType(Test).configureEach {
84103
useJUnitPlatform()
104+
105+
// Java 17+ module access for cglib/Spock mocking
106+
jvmArgs = [
107+
'--add-opens=java.base/java.lang=ALL-UNNAMED',
108+
'--add-opens=java.base/java.util=ALL-UNNAMED',
109+
'--add-opens=java.base/java.lang.reflect=ALL-UNNAMED',
110+
'--add-opens=java.base/java.io=ALL-UNNAMED',
111+
'--add-opens=java.base/java.net=ALL-UNNAMED'
112+
]
85113
}
86114

87115
task copyToLib(type: Copy) {
@@ -114,8 +142,24 @@ jar {
114142
publishing {
115143
publications {
116144
maven(MavenPublication) {
145+
groupId = 'com.rundeck.plugins'
117146
artifactId = 'ansible-plugin'
147+
version = project.version
118148
from components.java
119149
}
120150
}
151+
152+
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+
}
163+
}
164+
}
121165
}

functional-test/build.gradle

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

1313
configurations {
14-
configurations {
15-
instrumentedClasspath {
16-
canBeConsumed = false
17-
}
18-
}
19-
2014
// Security: Force resolution of vulnerable dependencies
2115
all {
2216
resolutionStrategy {

gradle/libs.versions.toml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
[versions]
22
# Security-fixed versions
3-
commons-lang3 = "3.18.0"
3+
commons-lang3 = "3.17.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.16.1"
9+
jackson = "2.21.2"
1010
snakeyaml = "2.2"
11-
groovy = "3.0.15"
11+
groovy = "4.0.29"
1212
lombok = "1.18.30"
13-
spock = "2.1-groovy-3.0"
13+
spock = "2.4-groovy-4.0"
1414
testcontainers = "1.19.0"
15-
rd-api-client = "2.0.8"
15+
rd-api-client = "2.0.9"
1616
jsch = "0.1.55"
17+
bytebuddy = "1.14.11"
18+
objenesis = "3.4"
1719

1820
# Rundeck version
19-
rundeck-core = "5.16.0-20251006"
21+
rundeck-core = "6.0.0-SNAPSHOT"
2022

2123
[libraries]
2224
# Security overrides
@@ -29,11 +31,13 @@ gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
2931
jackson-core = { module = "com.fasterxml.jackson.core:jackson-core", version.ref = "jackson" }
3032
jackson-dataformat-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" }
3133
snakeyaml = { module = "org.yaml:snakeyaml", version.ref = "snakeyaml" }
32-
groovy-all = { module = "org.codehaus.groovy:groovy-all", version.ref = "groovy" }
34+
groovy-all = { module = "org.apache.groovy:groovy-all", version.ref = "groovy" }
3335
lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" }
3436
spock-core = { module = "org.spockframework:spock-core", version.ref = "spock" }
3537
testcontainers = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" }
3638
testcontainers-spock = { module = "org.testcontainers:spock", version.ref = "testcontainers" }
3739
rd-api-client = { module = "org.rundeck.api:rd-api-client", version.ref = "rd-api-client" }
3840
jsch = { module = "com.jcraft:jsch", version.ref = "jsch" }
39-
rundeck-core = { module = "org.rundeck:rundeck-core", version.ref = "rundeck-core" }
41+
rundeck-core = { module = "org.rundeck:rundeck-core", version.ref = "rundeck-core" }
42+
bytebuddy = { module = "net.bytebuddy:byte-buddy", version.ref = "bytebuddy" }
43+
objenesis = { module = "org.objenesis:objenesis", version.ref = "objenesis" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

jitpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
jdk:
2-
- openjdk11
2+
- openjdk17

settings.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
enableFeaturePreview('VERSION_CATALOGS')
2-
31
rootProject.name = 'ansible-plugin'
42
include 'functional-test'

src/test/groovy/com/rundeck/plugins/ansible/plugin/AnsibleResourceModelSourceSpec.groovy

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ class AnsibleResourceModelSourceSpec extends Specification {
3434
getPropertyLookup() >> Mock(IPropertyLookup){
3535
getProperty("framework.tmp.dir") >> '/tmp'
3636
}
37-
getBaseDir() >> Mock(File) {
38-
getAbsolutePath() >> '/tmp'
39-
}
37+
getBaseDir() >> new File('/tmp')
4038
}
4139
ResourceModelSource plugin = new AnsibleResourceModelSource(framework)
4240
Properties config = new Properties()
@@ -104,9 +102,7 @@ class AnsibleResourceModelSourceSpec extends Specification {
104102
getPropertyLookup() >> Mock(IPropertyLookup){
105103
getProperty("framework.tmp.dir") >> '/tmp'
106104
}
107-
getBaseDir() >> Mock(File) {
108-
getAbsolutePath() >> '/tmp'
109-
}
105+
getBaseDir() >> new File('/tmp')
110106
}
111107
ResourceModelSource plugin = new AnsibleResourceModelSource(framework)
112108
Properties config = new Properties()
@@ -137,9 +133,7 @@ class AnsibleResourceModelSourceSpec extends Specification {
137133
void "ansible yaml data size parameter with an Exception"() {
138134
given:
139135
Framework framework = Mock(Framework) {
140-
getBaseDir() >> Mock(File) {
141-
getAbsolutePath() >> '/tmp'
142-
}
136+
getBaseDir() >> new File('/tmp')
143137
getPropertyLookup() >> Mock(IPropertyLookup){
144138
getProperty("framework.tmp.dir") >> '/tmp'
145139
}
@@ -175,9 +169,7 @@ class AnsibleResourceModelSourceSpec extends Specification {
175169
getPropertyLookup() >> Mock(IPropertyLookup){
176170
getProperty("framework.tmp.dir") >> '/tmp'
177171
}
178-
getBaseDir() >> Mock(File) {
179-
getAbsolutePath() >> '/tmp'
180-
}
172+
getBaseDir() >> new File('/tmp')
181173
}
182174
ResourceModelSource plugin = new AnsibleResourceModelSource(framework)
183175
Properties config = new Properties()
@@ -229,9 +221,7 @@ class AnsibleResourceModelSourceSpec extends Specification {
229221
void "tag hosts is empty"() {
230222
given:
231223
Framework framework = Mock(Framework) {
232-
getBaseDir() >> Mock(File) {
233-
getAbsolutePath() >> '/tmp'
234-
}
224+
getBaseDir() >> new File('/tmp')
235225
getPropertyLookup() >> Mock(IPropertyLookup){
236226
getProperty("framework.tmp.dir") >> '/tmp'
237227
}
@@ -285,9 +275,7 @@ class AnsibleResourceModelSourceSpec extends Specification {
285275
getPropertyLookup() >> Mock(IPropertyLookup){
286276
getProperty("framework.tmp.dir") >> '/tmp'
287277
}
288-
getBaseDir() >> Mock(File) {
289-
getAbsolutePath() >> '/tmp'
290-
}
278+
getBaseDir() >> new File('/tmp')
291279
}
292280
AnsibleResourceModelSource plugin = new AnsibleResourceModelSource(framework)
293281
Properties config = new Properties()
@@ -330,9 +318,7 @@ class AnsibleResourceModelSourceSpec extends Specification {
330318
getPropertyLookup() >> Mock(IPropertyLookup){
331319
getProperty("framework.tmp.dir") >> '/tmp'
332320
}
333-
getBaseDir() >> Mock(File) {
334-
getAbsolutePath() >> '/tmp'
335-
}
321+
getBaseDir() >> new File('/tmp')
336322
}
337323
AnsibleResourceModelSource plugin = new AnsibleResourceModelSource(framework)
338324
Properties config = new Properties()
@@ -378,9 +364,7 @@ class AnsibleResourceModelSourceSpec extends Specification {
378364
getPropertyLookup() >> Mock(IPropertyLookup){
379365
getProperty("framework.tmp.dir") >> '/tmp'
380366
}
381-
getBaseDir() >> Mock(File) {
382-
getAbsolutePath() >> '/tmp'
383-
}
367+
getBaseDir() >> new File('/tmp')
384368
}
385369
AnsibleResourceModelSource plugin = new AnsibleResourceModelSource(framework)
386370
Properties config = new Properties()

0 commit comments

Comments
 (0)