Rancher plugin for Jenkins

Anyone used rancher plugin for jenkins to deploy containers to rancher?

I am using this plugin https://wiki.jenkins.io/display/JENKINS/Rancher+Plugin#app-switcher

To being with, I deployed a hello-world container in Rancher by adding a host and then new container from UI.

Next I tried to automate through Jenkins. Followed all the instructions as per plugin page.
I was confused with the “Service Name” field.

Question:
What should be the service name .

My stacks has All / User /Infrastructure options only.

I figured it out.
We can give any name to the service name section. It will create that if not existing already.
Only environment ID and docker image should be correct.

Thanks,
Vishnu

Hello Vishnuvpotty,

I am using Rancher 1.x ,jenkins 2.x and sonatype-nexus3 as three separate containers. I have created a docker private registry in sonatype and stored the docker image there. Also integrated that private docker registry of sonatype to Rancher. Now I am trying to build a job in jenkins which will run the image of nexus repo in rancher as a container. I tried using jenkins racher plugin for it but got the following error. You got any idea on this error?

java.lang.RuntimeException: Some Error Happen statusCode 404 response: {“id”:“08709811-65e8-481b-97c5-00e1d86b2c09”,“type”:“error”,“links”:{},“actions”:{},“status”:404,“code”:“Not Found”,“message”:“Not Found”,“detail”:null,“baseType”:“error”}
at jenkins.plugins.rancher.HttpClient.execute(HttpClient.java:72)
at jenkins.plugins.rancher.HttpClient.get(HttpClient.java:31)
at jenkins.plugins.rancher.RancherClient.services(RancherClient.java:39)
at jenkins.plugins.rancher.RancherBuilder.perform(RancherBuilder.java:94)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)

Any help will be highly appreciated. Got stuck in this error from two days.
Thanks

1 Like

Hi did you found solution I am also stucked in same place cannot found environment id in rancher 2.1

Hi Vicky, you mean the environment id in Rancher 1.6 ?