I’m getting to my wits end. I’m trying to reproduce an issue from our corporate CBJ env, so I used the helm install to standup CBJ on my local k8s cluster. Seems good, using the kubernetes cloud provider with all defaults except to use websockets instead of TCP direct connect. I have a super simple pipeline defined so far just to test that the setup is sound:
podTemplate(yaml: '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: java17
image: amazoncorretto:17-alpine-full
command:
- tail
args:
- -f
- /dev/null
''') {
node(POD_LABEL) {
stage("test") {
container('java17') {
sh "java -version"
}
}
}
}
The error I get is
java.lang.NoSuchMethodError: No such DSL method 'stage' found among steps [...]
it then exhaustively lists every other possible step. If I remove the stage
block, making container
the first block under node(..)
, then it works as expected, output:
+ java -version
openjdk version "17.0.7" 2023-04-18 LTS
OpenJDK Runtime Environment Corretto-17.0.7.7.1 (build 17.0.7+7-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.7.7.1 (build 17.0.7+7-LTS, mixed mode, sharing)
My research has found that there’s a pipeline-stage-step plugin, but it doesn’t show up as an available plugin to install, nor does it show up as an installed plugin. If I use the Jenkins CLI,
java -jar jenkins-cli.jar -s http://cloudbees.my-local-domain/cjoc/ -auth USER:PASS install-plugin https://updates.jenkins.io/download/plugins/pipeline-stage-step/305.ve96d0205c1c6/pipeline-stage-step.hpi
It says it’s Installing a plugin from … - but nothing changes on Jenkins (pipeline doesn’t work, can’t see this plugin available or installed).
I’ve got a fair few years around the Jenkins block, but this has me stumped. Anyone have any idea what’s going on?
Thanks in advance!
Cheers.