I stumbled across a way to hang a workflow, by creating and running the following script (it'll work fine with the equivalent freestyle job):
node { git url:'https://github.com/jenkinsci/workflow-plugin.git', branch:'master' echo 'nope' sh 'git clean -fdx' }
The following output is shown in the console:
Started by user anonymous Running: Allocate node : Start Running on master in /var/jenkins_home/jobs/hangit/workspace Running: Allocate node : Body : Start Running: Git > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/jenkinsci/workflow-plugin.git # timeout=10 Fetching upstream changes from https://github.com/jenkinsci/workflow-plugin.git > git --version # timeout=10 > git -c core.askpass=true fetch --tags --progress https://github.com/jenkinsci/workflow-plugin.git +refs/heads/*:refs/remotes/origin/* > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10 Checking out Revision 101be9ca2431ec22e6e39b84d94d503852bb8272 (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f 101be9ca2431ec22e6e39b84d94d503852bb8272 First time build. Skipping changelog. Running: Print Message nope Running: Shell Script [workspace] Running shell script
The workflow can be aborted manually, but as far as I can tell does not complete (though it hasn't been left overnight, so it might finish eventually).
- duplicates
-
JENKINS-27152 Store sh control files outside of workspace
- Resolved