[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: OpenShift Gitlab webhook Jenkins issues.





On Tue, Aug 22, 2017 at 10:25 AM, Gabe Montero <gmontero redhat com> wrote:


On Mon, Aug 21, 2017 at 8:08 AM, Thorvald Hallvardsson <thorvald hallvardsson gmail com> wrote:
Hi Ben,

yes you got right understanding of my problem. 

There is no build associated yet, as it doesn't even get to the stage when it would fireup any build for the pipeline. It's literally a scond after sending the build task to Jenkins.... 

To tweak Ben's request slightly, can you provide the *buildconfig* json.  The precise structure of the gitlab webhook will most likely be helpful for us, especially
in comparison to the gitlab specs  and what the git plugin is spitting out.

Well, both the buildconfig and build.  What I want to see in the build object is what the revision information shows.  The gitlab webhook should have provided revision information to openshift which should have put that information into the BuildRequest which would have lead to that information being part of the Build object.

Assuming it's there, the next question is how the pipeline job in jenkins is intended to consume that revision information when cloning the repo to extract the Jenkinsfile.

Since we have two sources of git revision information in the build object, it's possible that one of them is being ignored by the sync plugin.

Thorvald, can you provide the buildconfig and build json from your openshift environment?

 

OpenShift version is 3.5. Jenkins sync plugin is 0.1.25. 

Regards,
TH


On 18 August 2017 at 21:56, Ben Parees <bparees redhat com> wrote:


On Fri, Aug 18, 2017 at 4:39 AM, Thorvald Hallvardsson <thorvald hallvardsson gmail com> wrote:
Hi,

I configured Gitlab webhook for my test pipeline to fire up a build. The problem is as soon as I commit something jenkins complains with an error below:

To make sure i understand your scenario, you've defined a pipeline buildconfig in openshift and enabled a gitlab webhook trigger to trigger the build?  (vs defining a gitlab trigger in jenkins itself).

 

OpenShift Build jenkins/nodejs-pipeline-master-3 from http://gitlab.os.hr4.local/jenkins/nodejs-ex-1.git
Checking out git http://gitlab.os.hr4.local/jenkins/nodejs-ex-1.git to read Jenkinsfile
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url http://gitlab.os.hr4.local/jenkins/nodejs-ex-1.git # timeout=10
 > git --version # timeout=10
 > git fetch --tags --progress http://gitlab.os.hr4.local/jenkins/nodejs-ex-1.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse null^{commit} # timeout=10
hudson.plugins.git.GitException: Command "git rev-parse null^{commit}" returned status code 128:
stdout: null^{commit}

stderr: fatal: ambiguous argument 'null^{commit}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1799)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1772)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1768)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1415)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1427)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:686)
at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316)
at hudson.plugins.git.RevisionParameterAction.toRevision(RevisionParameterAction.java:98)
at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:991)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1108)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:130)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:59)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:232)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:405)
Finished: FAILURE

It works when I take generic webhook URL however it engages a build regardless of which branch I'm commiting the change to - which is no ideal.

Any ideas why commit number in the code above is null ?

can you share the build json associated w/ the build that was kicked off by the webhook trigger?

also what version of the openshift sync plugin are you running and what version is your openshift cluster?


 

Thanks
TH

_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users




--
Ben Parees | OpenShift



_______________________________________________
users mailing list
users lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/users





--
Ben Parees | OpenShift


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]