Closed Torbacka closed 6 years ago
hey @Torbacka - yeah, buildConfig
is suppose to work. And in fact, using the openshift sample template https://github.com/openshift/origin/blob/master/examples/jenkins/pipeline/samplepipeline.yaml, which has this in the pipeline:
node('nodejs') {
stage('build') {
openshiftBuild(buildConfig: 'nodejs-mongodb-example', showBuildLogs: 'true')
}
stage('deploy') {
openshiftDeploy(deploymentConfig: 'nodejs-mongodb-example')
}
}
works for me.
I'm at the same version of jenkins and this plugin as you.
So something else is going on.
If you want to pursue further, please provide:
And we can debug what is going on.
Thanks.
Yeah your code works fine for me. The problem seem to be that Im using declarative pipeline. When Im running it like this I get the error.
pipeline {
agent any
stages {
stage('build') {
steps {
openshiftBuild(buildConfig: 'intagiutest', showBuildLogs: 'true')
}
}
stage('deploy') {
steps {
openshiftDeploy(deploymentConfig: 'nodejs-mongodb-example')
}
}
}
}
Yep, that is the difference @Torbacka
With declarative, the workflow engine is not longer calling https://github.com/openshift/jenkins-plugin/blob/master/src/main/java/com/openshift/jenkins/plugins/pipeline/dsl/OpenShiftBuilder.java#L120
which is where we are doing the param name mapping
A README update is in fact warranted, but rather then a generic "only use ###" it needs to be qualified around declarative vs. scripted pipelines.
I'll be submitting a PR shortly.
thanks
Error message from jenkins:
How to reproduce error:
Solution: I think you should rename the parameter name buildConfig to bldCfg in the README.md, but maybe i have misunderstood something. #