openshift / jenkins-plugin

Apache License 2.0
81 stars 50 forks source link

FR: Using variables as substring in names of configurations #49

Closed livelace closed 8 years ago

livelace commented 8 years ago

Hello. At the moment we can use variables like this:

VERSION=centos

The name of the DeploymentConfig to scale: VERSION

But we can not do like this:

The name of the DeploymentConfig to scale: drweb-fss-VERSION or drweb-fss-$VERSION or drweb-fss-${VERSION} or drweb-fss-${VERSION}-rpm

We have a lot of similar tasks, which are different only in software version.

gabemontero commented 8 years ago

sure, I could see supporting both $VERSION and ${VERSION} style embedded variables for parameter values (EnvVars and the standard plugins in this space support both) with little trouble.

I'll most likely start cooking a new version of the plugin for some recent fixes in the next couple of days. I'll see if I can incorporate this change as part of that.

@bparees FYI

livelace commented 8 years ago

@gabemontero Thanks! :)

gabemontero commented 8 years ago

YW @livelace

By the way, after digging some more, at least for mixed items like drweb-fss-${VERSION}, in experimenting with some of the existing Jenkins utilities, only ${VERSION} works ... $VERSION works if that is the only thing in the string, but not in the mixed case.

So I'll just support ${VERSION} for mixed items.

livelace commented 8 years ago

@gabemontero

Cool! It will allow us to shrink a lot of Jenkins jobs to task with parameters :)

gabemontero commented 8 years ago

OK, I've delivered the change with https://github.com/openshift/jenkins-plugin/commit/474c088557c7a2059e5c5ff065971603d01ea91d

Aside from the code change, I updated the README's Providing parameter values section, clarifying the new behavior.

I've created a pre-release version of the plugin at https://ci.openshift.redhat.com/jenkins/job/openshift-pipeline-plugin/25/s3/download/openshift-pipeline.hpi

I'm going to be starting the official release process probably Thursday, but if you can try the pre-release version before that @livelace , let me know if you see any issues, etc. and I'll make updates as needed.

thanks

livelace commented 8 years ago

Hmm. It seems working. Multiple variables working fine in name of: deployments, builds, image tags. Old tasks are working too. Thanks!

gabemontero commented 8 years ago

Great - thanks for trying it out!

On Wednesday, July 13, 2016, Oleg Popov notifications@github.com wrote:

Hmm. It seems working. Multiple variables working fine in name of: deployments, builds, image tags. Old tasks are working too. Thanks!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/openshift/jenkins-plugin/issues/49#issuecomment-232338598, or mute the thread https://github.com/notifications/unsubscribe/ADbadJfk-GId-P9PKBIKocgBzhDOi0Jaks5qVNhUgaJpZM4JKIkS .