How to skip Parent project in Jenkins Pipeline

63 views
Skip to first unread message

ilter P

unread,
Nov 25, 2016, 7:11:54 PM11/25/16
to fabric8
Hi,

I have a maven project with parent. I am importing it to Fabric8 console with "Calary release"
I am getting an error related the parent project ,Here is the error message:


[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 02:34 min

[INFO] Finished at: 2016-11-25T23:24:02+00:00

sh-4.2# exit

exit

[INFO] Final Memory: 103M/552M

[INFO] ------------------------------------------------------------------------

[Pipeline] fileExists

[Pipeline] echo

Warning OpenShift YAML target/classes/META-INF/fabric8/openshift.yml does not exist!

[Pipeline] echo

s2i mode: false

[Pipeline] echo

Running on a single node, skipping docker push as not needed

[Pipeline] readMavenPom

[Pipeline] tagImage

Tagging image:microservices/testproject-parent:1.0.3 with tag:1.0.3.

[Pipeline] }

[Pipeline] // container

[Pipeline] }

[Pipeline] // node

[Pipeline] }

[Pipeline] // podTemplate

[Pipeline] End of Pipeline

io.fabric8.docker.client.DockerClientException: Failure executing: POST at: http://localhost/images/microservices/testproject-parent:1.0.3/tag?tag=1.0.3&force=false&repo=172.30.81.80:80/microservices/testproject-parent. Status:404. Message: Not Found. Body: no such id: microservices/testproject-parent:1.0.3

at io.fabric8.docker.client.impl.OperationSupport.requestFailure(OperationSupport.java:255)

at io.fabric8.docker.client.impl.OperationSupport.assertResponseCodes(OperationSupport.java:239)

at io.fabric8.docker.client.impl.OperationSupport.handleResponse(OperationSupport.java:191)

at io.fabric8.docker.client.impl.TagImage.withTagName(TagImage.java:88)

at io.fabric8.docker.client.impl.TagImage.withTagName(TagImage.java:33)

at io.fabric8.kubernetes.pipeline.TagImageStepExecution$1.call(TagImageStepExecution.java:50)

at io.fabric8.kubernetes.pipeline.TagImageStepExecution$1.call(TagImageStepExecution.java:41)

at hudson.remoting.UserRequest.perform(UserRequest.java:121)

at hudson.remoting.UserRequest.perform(UserRequest.java:49)

at hudson.remoting.Request$2.run(Request.java:326)

at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at hudson.remoting.Engine$1$1.run(Engine.java:69)

at java.lang.Thread.run(Thread.java:745)

at ......remote call to kubernetes-eabe945d9f9a4992936ef7a1395ffcf3-54a41fd0c60(Native Method)

at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1433)

at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)

at hudson.remoting.Channel.call(Channel.java:797)

at io.fabric8.kubernetes.pipeline.TagImageStepExecution.run(TagImageStepExecution.java:41)

at io.fabric8.kubernetes.pipeline.TagImageStepExecution.run(TagImageStepExecution.java:28)

at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)

at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:184)

at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:126)

at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)

at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)

at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:16)

at io.fabric8.kubernetes.pipeline.Kubernetes$TagImage.withTag(jar:file:/var/jenkins_home/plugins/kubernetes-pipeline-steps/WEB-INF/lib/kubernetes-pipeline-steps.jar!/io/fabric8/kubernetes/pipeline/Kubernetes.groovy:298)

at io.fabric8.kubernetes.pipeline.Kubernetes.node(jar:file:/var/jenkins_home/plugins/kubernetes-pipeline-steps/WEB-INF/lib/kubernetes-pipeline-steps.jar!/io/fabric8/kubernetes/pipeline/Kubernetes.groovy:33)

at io.fabric8.kubernetes.pipeline.Kubernetes$TagImage.withTag(jar:file:/var/jenkins_home/plugins/kubernetes-pipeline-steps/WEB-INF/lib/kubernetes-pipeline-steps.jar!/io/fabric8/kubernetes/pipeline/Kubernetes.groovy:297)

at mavenCanaryRelease.call(/var/jenkins_home/jobs/iot-services/builds/3/libs/github.com/fabric8io/fabric8-pipeline-library/vars/mavenCanaryRelease.groovy:26)

at WorkflowScript.run(WorkflowScript:54)

at ___cps.transform___(Native Method)

at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:48)

at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)

at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)

at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)

at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)

at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)

at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)

at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:76)

at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)

at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)

at sun.reflect.GeneratedMethodAccessor300.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)

at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)

at com.cloudbees.groovy.cps.Next.step(Next.java:58)

at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)

at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)

at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)

at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:163)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:324)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:78)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:236)

at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:224)

at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:63)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)

at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

Finished: FAILURE



It works fine with mvn fabric8:deploy but not in the Jenkins Build.

How can i resolve this issue, do i have to change my JenkinsFile script ?


Thanks


James Strachan

unread,
Nov 26, 2016, 4:07:04 AM11/26/16
to ilter P, fabric8
is the parent pom released so that the imported project can be found? I guess it works locally as you've built things in your local ~/.m2/repository?

Any chance of the full jenkins build log output - I'd have thought if it was a parent pom.xml issue the compile stage would have failed?

--
You received this message because you are subscribed to the Google Groups "fabric8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
James
-------
Red Hat

Twitter: @jstrachan
Email: james.s...@gmail.com
Blog: https://medium.com/@jstrachan/

open source microservices platform

ilter P

unread,
Nov 28, 2016, 12:31:05 PM11/28/16
to fabric8, ilterp...@gmail.com
Hi James,

Thanks for the reply.

Yes in my local it works fine. I use mvn fabric8:deploy and i can see succesfully build and all pods in minishift as well.
I managed to get log output, here is in the log.txt in attachment.

Regards
To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
log.txt

Abdelfattah Mahran

unread,
Dec 6, 2016, 4:02:42 PM12/6/16
to fabric8
Hi guys,

I'm facing the same error? there is any solution for that?

Thanks,
best regards,

James Rawlings

unread,
Dec 6, 2016, 4:11:06 PM12/6/16
to Abdelfattah Mahran, fab...@googlegroups.com
Hi, is the project that you're building on github?  It would be easier to work out what's going on if we had an example to recreate the problem with.

Thanks, James.
--
James Rawlings
Engineering
Red Hat, Inc.
Blog: https://medium.com/@jdrawlings
Twitter: @jdrawlings

https://fabric8.io/
https://blog.fabric8.io/


Abdelfattah Mahran

unread,
Dec 6, 2016, 4:55:48 PM12/6/16
to fabric8, abdoo....@gmail.com
Hi James,

Project is not in github but it is something like that

main_dir/:
.  ..  .git  parent_project

main_dir/parent_project:
.  ..  project01  .gitignore  project02  pom.xml  project03

main_dir/parent_project/project01:
.  ..  p01  p02  p03  pom.xml

Thanks,
best regards,

Abd El-Fattah Mahran

unread,
Dec 6, 2016, 5:25:57 PM12/6/16
to fabric8, Abdul Fattah Mahran
Hi James,

It is an internal project so let me know what you need and I can provide

best regards,
--
Thanks
Best Regards,
Abd El-Fattah Mahran

http://www.linkedin.com/in/abdoomahran

James Strachan

unread,
Dec 7, 2016, 4:53:32 AM12/7/16
to ilter P, fabric8
it looks like the build worked fine; its just the logic to detect if its using S2I or not failed as the root directory didn't have the docker image inside - so it tried to push to a local docker registry after doing a S2I build

So we just need to fix the S2I detection function to find the first real openshift.yml file recursirvely in the current directory:

To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

James Strachan

unread,
Dec 7, 2016, 4:55:21 AM12/7/16
to Abd El-Fattah Mahran, fabric8
a workaround could be to just edit the Jenkinsfile and run a "cd" command before you start building via maven?


    container(name: 'maven') {

      stage 'Build Release'

      // add a CD first...
      sh "cd my-module-name"

      mavenCanaryRelease {
        version = canaryVersion
      }
      





To unsubscribe from this group and stop receiving emails from it, send an email to fabric8+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Abd El-Fattah Mahran

unread,
Dec 7, 2016, 10:27:20 AM12/7/16
to James Strachan, fabric8
Hi James,

I have multiple modules, how can I make it dynamic "my-module-name"?

Thanks,
best regards,

James Strachan

unread,
Dec 7, 2016, 10:29:15 AM12/7/16
to Abd El-Fattah Mahran, fabric8
the Jenkinsfile is groovy - you can use code ;) so you could look at the job name, build number and source code to decide which module you want to build in your Jenkinsfile

Abd El-Fattah Mahran

unread,
Dec 7, 2016, 10:33:08 AM12/7/16
to James Strachan, fabric8
sorry James I'm still newpie to fabric8, I will appreciate if you can send an example :-)

James Strachan

unread,
Dec 7, 2016, 10:43:26 AM12/7/16
to Abd El-Fattah Mahran, fabric8
here's some groovy code which conditionally does things based on the presence of a file

this might help http://groovy-lang.org/syntax.html - though can pretend groovy is the same as java syntax if you prefer and already know java
Reply all
Reply to author
Forward
0 new messages