Thanks @Mark. I switched to using refspecs and it seems to have addressed 
the issue. 

On Tuesday, June 27, 2017 at 5:53:07 PM UTC-4, Abhijith Reddy wrote:
>
> Whenever i specify a branch with GitSCM i see the following issue
> Couldn't find any revision to build. Verify the repository and branch 
> configuration for this job.
>
> Here's my Jenkinsfile
>
> node {
>
>     deleteDir()
>     checkout([$class: 'GitSCM', branches: [[name: 'feature/my-branch]], 
> doGenerateSubmoduleConfigurations: false, extensions: [[$class: 
> 'CleanBeforeCheckout'],[$class: 'PruneStaleBranch']], submoduleCfg: [], 
> userRemoteConfigs: [[credentialsId: 'aaa-aaa-aaa-aaa', url: GIT_URL]]])
> }
>
>
> and here is the error
>
>
> Checking out git ssh://g...@stash.com:7999/capt/jenkins-pipelines.git to 
> read Jenkinsfile-pull-request
> Wiping out workspace first.
> Cloning the remote Git repository
> Cloning repository ssh://g...@stash.com:7999/capt/jenkins-pipelines.git
>  > git init 
> /var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline@script
>  
> # timeout=10
> Fetching upstream changes from ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git
>  > git --version # timeout=10
> using GIT_SSH to set credentials automated repo access
>  > git fetch --tags --progress ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git 
> +refs/heads/*:refs/remotes/origin/*
>  > git config remote.origin.url ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git # timeout=10
>  > git config --add remote.origin.fetch 
> +refs/heads/*:refs/remotes/origin/* # timeout=10
>  > git config remote.origin.url ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git # timeout=10
> Fetching upstream changes from ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git
> using GIT_SSH to set credentials automated repo access
>  > git fetch --tags --progress ssh://
> g...@stash.com:7999/capt/jenkins-pipelines.git 
> +refs/heads/*:refs/remotes/origin/*
>  > git rev-parse origin/develop^{commit} # timeout=10
> Checking out Revision 81cbf859af011118d159c8c3a89cb796b4b1b536 
> (origin/develop)
>  > git config core.sparsecheckout # timeout=10
>  > git checkout -f 81cbf859af011118d159c8c3a89cb796b4b1b536
>  > git rev-list 571b6661262fa11ce2e1088338c1f19cd1a5110d # timeout=10
> First time build. Skipping changelog.
> [Pipeline] node
> Running on q7bld02 in 
> /var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline
> [Pipeline] {
> [Pipeline] deleteDir
> [Pipeline] checkout
> Cloning the remote Git repository
> Cloning repository ssh://g...@stash.com:7999/api/mpp.git
>  > git init 
> /var/lib/jenkins/workspace/API/merchant-profile-and-preferences/pr-pipeline 
> # timeout=10
> Fetching upstream changes from ssh://g...@stash.com:7999/api/mpp.git
>  > git --version # timeout=10
> using GIT_SSH to set credentials automated repo access
>  > git fetch --tags --progress ssh://g...@stash.com:7999/api/mpp.git 
> +refs/heads/*:refs/remotes/origin/*
>  > git config remote.origin.url ssh://g...@stash.com:7999/api/mpp.git # 
> timeout=10
>  > git config --add remote.origin.fetch 
> +refs/heads/*:refs/remotes/origin/* # timeout=10
>  > git config remote.origin.url ssh://g...@stash.com:7999/api/mpp.git # 
> timeout=10
> Cleaning workspace
>  > git rev-parse --verify HEAD # timeout=10
> No valid HEAD. Skipping the resetting
>  > git clean -fdx # timeout=10
> Pruning obsolete local branches
> Fetching upstream changes from ssh://g...@stash.com:7999/api/mpp.git
> using GIT_SSH to set credentials automated repo access
>  > git fetch --tags --progress ssh://g...@stash.com:7999/api/mpp.git 
> +refs/heads/*:refs/remotes/origin/* --prune
>  > git rev-parse feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
> timeout=10
>  > git rev-parse 
> refs/remotes/origin/feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
> timeout=10
>  > git rev-parse feature/XMEN-512-dup​licate-contact-clean​up^{commit} # 
> timeout=10
> [Pipeline] }
> [Pipeline] // node
> [Pipeline] End of Pipeline
> ERROR: Couldn't find any revision to build. Verify the repository and 
> branch configuration for this job.
> Finished: FAILURE
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/525a3083-cbd7-42fa-83a4-cce609c08935%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to