Prior Jenkins2 I was using Build Pipeline Plugin to build and manually deploy application to server. Old configuration:
That works great, but I want to use new Jenkins pipeline, generated from groovy script (Jenkinsfile), to create manual step.
So far I came up with input
jenkins step.
Used jenkinsfile script:
node { stage 'Checkout' // Get some code from repository stage 'Build' // Run the build } stage 'deployment' input 'Do you approve deployment?' node { //deploy things }
But this waits for user input, noting that build is not completed. I could add timeout to input
, but this won't allow me to pick/trigger a build and deploy it later on:
How can I achive same/similiar result for manual step/trigger with new jenkins-pipeline as prior with Build Pipeline Plugin?
To create a simple pipeline from the Jenkins interface, perform the following steps: Click New Item on your Jenkins home page, enter a name for your (pipeline) job, select Pipeline, and click OK. In the Script text area of the configuration screen, enter your pipeline syntax.
Step 1: Log into Jenkins and select 'New item' from the dashboard. Step 2: Next, enter a name for your pipeline and select 'pipeline' project. Click on 'ok' to proceed. Step 3: Scroll down to the pipeline and choose if you want a declarative pipeline or a scripted one.
This is a huge gap in the Jenkins Pipeline capabilities IMO. Definitely hard to provide due to the fact that a pipeline is a single job. One solution might be to "archive" the workspace as an "artifact" (tar and archive **/* as 'workspace.tar.gz'), and then have another pipeline copy the artifact and and untar it into the new workspace. This allows the second pipeline to pickup where the previous one left off. Of course there is no way to gauentee that the second pipeline cannot be executed out of turn or more than once. Which is too bad. The Delivery Pipeline Plugin really shines here. You execute a new pipeline right from the view - instead of the first job. Anyway - not much of an answer - but its the path I'm going to try.
EDIT: This plugin looks promising:
https://github.com/jenkinsci/external-workspace-manager-plugin/blob/master/doc/PIPELINE_EXAMPLES.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With