Webinar Q&A: Facilitating Continuous Delivery Pipelines with Jenkins Workflow

10 min read
Stay connected

Thank you to everyone who joined us for the webinar with eSynergy--youcan view the recording here .

Below are the link found in the slides from the webinar:

Get The Code:

https://github.com/harniman/workflow-demos
https://github.com/harniman/spring-petclinic
https://github.com/jenkinsci/workflow-plugin/blob/controller/COMPATIBILITY.md

Tutorial:

https://github.com/jenkinsci/workflow-plugin/blob/controller/TUTORIAL.md

Jenkins Enterprise by CloudBees Workflow-Related Functionality:

http://jenkins-enterprise.cloudbees.com/docs/user-guide-docs/workflow.html

Following are answers to the questions we received during the webinar:
________________________________________________________________

Q: Can 'pause for input" can be accepted via api?

A: Yes you can POST to a URL to proceed.

Q: Any support for Android Emulator in workflow?

A: No specific support yet that we are aware of. You can use `sh` steps to launch and tear down the emulator.

Q: Are you developing any plugins/workflows that uses Puppet/Chef?

A: Not currently, though of course you can run such commands from shell scripts. There is a plugin that allows tracking of puppet deployments.

Q: Pending JENKINS-27295 Booleans end up as Strings in the Groovy script. Is there a workaround?

A: Currently you would use Boolean.parse or just check MYPARAM == 'true'

Q: Can the DSL be extended with new commands?, For example to call things specific to plugins and not present in core? Like running an xcode build.

A: DSL steps are contributed to by plugins.

Q: Is there a list of plugins compatible with Workflow?

A: See https://github.com/jenkinsci/workflow-plugin/blob/controller/COMPATIBILITY.md

Q: Can the DSL functions be reused across jobs?

A: You can `load` a file of Groovy functions you wrote, or commit a Groovy class to a Jenkins-managed Git repository and then import it from as many flows as you like.

Q: Can we restrict checkpoint to a particular access group who can click ok?

A: Not currently; just based on Job/Build permission.

Q: If we have 10 commits then would all 10 builds pause at Staging using up 10 executors unless someone clicks yes or no?

A: It is not using up executors while waiting (unless you are inside `node`). If you want to automatically cancel older prompts, that would be: https://issues.jenkins-ci.org/browse/JENKINS-27039

Q: Do we have ability to integrate with Jira? Like opening a task in Jira when the tests fail.

A: Its possible the JIRA plugin for Jenkins may implement this. Or if there is a way to access JIRA REST API e.g. from curl/wget you could do this today.

Q: Do you plan to implement a “task list” screen for a user to see all tasks awaiting their input?

A: Not at present. This would be a great RFE.

Q: How to enable own jars in workflow lib? Is that possible. Is that possible to download workflow lib directory from external git (scm) instead of use of "static" content?

A: External JARs in classpath (other than plugins) not currently supported. You can load *.groovy sources (interpreted) from the load step, or use a Jenkins-managed Git repo to save common classes/functions.

Q: How to take standard input/error and error code in shell script to manage step (sh command)?

A: See RFE: https://issues.jenkins-ci.org/browse/JENKINS-26133 which also contains workaround idioms.

Q: Can you propose interfaces for some commands using not only String but also Arrays? I.e. it is not possible to send mail to many recipients or set more than one submitter in input phrase because of String, not String[] interface?

A: For the `submitter` option to `input` you can set the name of an external group, for example LDAP group. Then anyone in that group may approve. In general yes steps can and do take arrays/maps where needed. Possible RFE, but I think https://issues.jenkins-ci.org/browse/JENKINS-27134 would be the better approach in general (integrates nicely with authorization strategy configuration for Jenkins overall).

Q: How can I add RFE request?

A: See https://github.com/jenkinsci/workflow-plugin#development

Q: When I run the code on agent the current dir and context is set to the workplace directory. Is this way to automatically set it to the job-numbered dir or I have to do it manually?

A: You can use the dir step to temporarily change directory (like pushd in shell scripts), or you can ask for a specific _locked_ workspace with the `ws` step.

Q: Is that possible to put some links into workflow report screen and/or workflow step screen (i.e. to show sonar, junit links)?

A: JUnit result archiving is supported. For Sonar use the https://wiki.jenkins-ci.org/display/JENKINS/Sidebar-Link+Plugin

Q: Do you plan to provide ability to group steps in step list (now each sh is separate step) to improve readability?

A: See https://issues.jenkins-ci.org/browse/JENKINS-26107

Q: Does Input send email to alert the responsible party?

A: No but you could use the distinct `mail` step to do so.

Q: Does workflow support multiconfiguration jobs? E.g. can I define configurations within the workflow to run multiple concurrent builds on different platforms and have each of these follow a workflow?

A: You can do so, although there is not currently a good way to separate displayed results by configuration. This is something we are thinking about adding.

Q: How hard is it to implement the github triggers?

A: See https://issues.jenkins-ci.org/browse/JENKINS-27136 You would need Java development experience and knowledge of Jenkins plugin APIs.

Q: Is build promotions a feature of Workflow? What does build promotion look like in Workflow?

A: The equivalent of the Promoted Builds plugin for Workflow would be build stages.

Q: Does workflow provide functionality to capture test result output of test stages and aggregate it similar to the JUnit test result reports in the build stage?

A: You can run test result archiving multiple times per build. Currently all such results are simply aggregated. https://issues.jenkins-ci.org/browse/JENKINS-27395 suggests refinements.

Q: Is there more than the simple proceed / cancel functionality to the transitions between stages?

A: https://issues.jenkins-ci.org/browse/JENKINS-27039 suggests other behaviors.

Q: Are checkpoints and resuming from checkpoints a feature reserved only for Jenkins Enterprise?

A: Yes. OSS Workflow does let builds survive simple Jenkins restarts (or agent disconnections and reconnections).

Q: Can workflow accommodate a deployment model that is asynchronous? We use Puppet to deploy. The handshake is via MQ so the deployment status is not available immediately.

A: I would suggest using the waitUntil step to wait for a deployment flag to be set. In the future there might be a step designed to wait for MQ events, or specifically for Puppet, etc.

Q: Is wait until asynchronous?

A: Yes, checks for the condition repeatedly, at increasingly long intervals if still false.

Q: If we are using a separate tool for Deploying apps, something like IBM uDeploy how does it integrate into the workflow?

A: You would use the `sh` (or `bat`) step to run it as an external process.

Q: If you have jobs which now continue past a Jenkins reboot, how do you restart jobs that are stuck in a poor state or need some attention?

A: You can cancel stuck builds if you need to.

Q: Is it competing with XebiaLabs XLRelease and/or Nolio ReleaseAutomation? Does it have inframent abstractions, does it has easy keystores for passwords needed?

A: Not really competing with that kind of product; more complementary. There is integration with the Credentials system in Jenkins.

Q: Is it possible to just get an enterprise version of this plugin or does it only come as part of a package?

A: Currently only as part of the Jenkins Enterprise package.

Q: Is the entire pipeline defined in a single file?

A: Yes. (Or you could define parts in a different file if that made things more readable.)

Q: Is the Job DSL plugin compatible with it? Or are they sort of competing plugins doing the same thing? (though I know Job DSL does not do workflows).

A: Job DSL supports Workflow as of a recent release.

Q: Can the Job DSL plugin generate workflow dsl?

A: Yes it can.

Q: Are there other ways to create workflow jobs?

A: Yes, you can use the Jenkins Enterprise Templates capability.

Q: Is there a way to have a particular user be able to authorize the proceed / cancel upon reaching an input point?

A: Yes, `input message: '...', submitter: 'thatUserID'`

Q: Can Jenkins be used as an artifact repository? Similar to Artifactory.

A: You can archive artifacts from the build, though if you have big files, or want to use them from other tools, you are recommended to use Artifactory/Nexus/etc.

Q: Is there a way to send an email to solicit input from non-technical users?

A: There is a `mail` step.

Q: Is there an option to launch Hadoop workflow jobs?

A: If there is a cloud provider for Jenkins generally, it can be used to run Workflow `node` steps on that kind of agent.

Q: Wanted to see if Jenkins can be a single place to launch jobs for hadoop, may internally Ooozie scheduler be used to launch, any option?

A: If there is a shell command you can run to launch the job, then you can do it from Workflow.

Q: Nowadays we rely on MultiBranch Project Plugin for support our development process based on Pull Request and Code Review. Is it possible to achieve the same result using workflow plugin?

A: Not currently but I would like to add such support: https://issues.jenkins-ci.org/browse/JENKINS-26129

Q: Where is there any source of work flow plugin job configurations aside from the github page?

A: A new tag for StackOverflow has been proposed.

Q: Is there perforce integration?

A: The new Perforce plugin (from Perforce) recently added Workflow support. The older one does not have it.

Q: Would you want to create a groovy script that contains functions that can be reused in other workflow builds, it should be a plugin?

A: Need not be a plugin, can just live in your SCM, etc.

Q: What is the recommended way to have reusable groovy parts shared among different jobs?

A: You can use the `load` step, or you can define classes in a Git repo hosted by Jenkins and which are then available for immediate import. Other options may be added in the future.

Q: Why is 'Surviving Restarts' implemented in a Plugin, and not in Jenkins Core?

A: Technical reasons too involved to go into here. Basically Jenkins was not originally designed to make that possible. Jenkins Enterprise provides a plugin to support Long Running Builds.

Q: Is Console output of parallel executions in any way grouped, or just all lines mixed up?

A: With lines intermingled, but prefixed by branch name.

Q: I have my workflow script in one SCM repo, but want to trigger the job from all changes in a different repo, can I do that? Or would I need to keep workflow script with my sources?

A: Yes, you can use as many repositories are you like from a single build, which may or may not be where the Groovy script is kept.

Q: Will there be an option to download the example workflow source?

A: Yes - https://github.com/harniman/workflow-demos

Q: How is the Jenkins workflow kept in a source code control system of some kind? For example to see what variables were defined as at some point in the past?

A: You can load your whole flow script, or just a part of it, from source control.

--Nigel Harniman
cloudbees.com

Nigel is a Senior Solution Architect at CloudBees.

Stay up to date

We'll never share your email address and you can opt out at any time, we promise.