I'm trying to use Jenkins on Cloudbees to automate deployment of my software. I setup my workflow as following.
There may be times I want to redeploy. (assuming that stage takes a manual input parameter). How do I do that in workflow ? Here is my Groovy script.
def src = 'https://git.repo.url/proj.git' stage 'Build' node { env.JAVA_HOME="${tool name: 'Pre-Installed OpenJDK 8 (Latest) on DEV@Cloud nodes', type: 'hudson.model.JDK'}" sh 'javac -version' git credentialsId: 'abcdef', url: src sh 'ant -f build.xml proj.jar report' } stage 'Generate Release Version' input message: 'Create Tar and Push to S3', ok: 'Generate Release' node { // TODO } stage 'QA Approved' input message: 'Enter a Tag Name to approve this build and tag in GIT', ok: 'Approve and Tag', parameters: [[$class: 'StringParameterDefinition', defaultValue: '', description: 'Eg: Sprint73', name: 'TAG_NAME']] node { // TODO } stage 'DevOps - Ansible' input message: 'Release to Production', ok: 'Release' node { // TODO } I tried using Job Chaining using Build Pipeline instead of Workflow so that I can repeat stages, but thats another story with too many jobs.
