jenkinsfile-runner: CasC not working with local build
I built the master of jenkinsfile-runner with:
mvn clean package
Then i changed into jenkinsfile-runner/demo/pipeline-library There i did in a bash shell:
CASC_JENKINS_CONFIG=$(pwd)/jenkins.yaml
java -jar ../../app/target/jenkinsfile-runner-standalone.jar -p ../../vanilla-package/target/plugins/ -f .
i got the following exception:
Started
Running in Durability level: PERFORMANCE_OPTIMIZED
[Pipeline] Start of Pipeline
[Pipeline] End of Pipeline
java.lang.NoSuchMethodError: No such DSL method 'buildPlugin'
Which is not what i expected. So i changed into jenkinsfile-runner/demo/casc and did there:
CASC_JENKINS_CONFIG=$(pwd)/config/jenkins.yaml
java -jar ../../app/target/jenkinsfile-runner-standalone.jar -p ../../vanilla-package/target/plugins/ -f .
And got as output:
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/folders/m7/jql3p30h8xl46m001s7q50mh0000gp/T/jenkinsfileRunner.tmp/jfr5797116649782649554.run/workspace/job
GOT CONTEXT FOR Build
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] echo
Hello world!
[Pipeline] echo
An environment variable configured via JCasC: null
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
With the null value for ${env.SOME_CASC_ENV_VAR} it seems to me obvious that the CasC mechanism at least in my environment is not working
My environment:
bash-3.2$ java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)
bash-3.2$ java -jar ../../app/target/jenkinsfile-runner-standalone.jar -p ../../vanilla-package/target/plugins/ -f .
No explicit version has been selected, using latest LTS
Running pipeline on jenkins 2.222.1
git log 628ms Do 2 Apr 18:18:59 2020
commit b8429941bbc8898876dcc3b975070f2d5707a822 (HEAD -> master, origin/master, origin/HEAD)
Merge: 1a25d1c 337b27d
Author: Oleg Nenashev <o.v.nenashev@gmail.com>
Date: Thu Mar 26 12:07:12 2020 +0100
Merge pull request #253 from LinuxSuRen/latest-plugin
Use latest as the default version of plugin
commit 337b27de0b0c3ab231d1a8d5ace22df78ba0a4fe
Author: rick <rick@jenkins-zh.cn>
Date: Sun Mar 8 22:41:48 2020 +0800
Use latest as the default version of plugin
Any suggestions?
Best thanks for the great work, a working CasC would be neat though
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (6 by maintainers)
Vanilla is also packaged to Docker so they are quite orthogonal. But yes, I hope to evolve the vanilla packaging a bit more so that one can actually use Jenkinsfile Runner without repackaging everything in simple use-cases. Custom WAAR Packager will be still needed for more advanced cases
NWS, I also had not noticed it until I tried. There are too many shells out there, and all of them handle env vars differently. I will add a note to the demo