Blueocean - Cloud Foundry plugin for Jenkinsfile pipeline

264 views
Skip to first unread message

Sekhar Kari

unread,
Feb 3, 2017, 1:21:19 PM2/3/17
to Jenkins Users
Installed Blueocean from the docker image docker pull jenkinsci/blueocean. I wanted to include a Cloud Foundry Deployment step(sh cf push) in my pipeline and stuck with the error 
script.sh: line 1: cf: not found

I knew what's happening - as there is no compatiable CF CLI plug-in the script command CF is not working. And I tried different things,

1)  In my Jenkinsfile, I Tried using the the Cloud foundry plug-in(CloudFoundryPushPublisher) which is supported in non-pipeline build. And that didn't help.
step([$class: 'com.hpe.cloudfoundryjenkins.CloudFoundryPushPublisher',

        target: 'https://api.ng.bluemix.net',

        organization: 'xxxx',

        cloudSpace: 'xxxxx',

        credentialsId: 'xxxxxx',

        selfSigned: true,

        resetIfExists: true]); - that failed with 'Invalid Argument exception'



My question is, I heared Cloudbee's has a commericial version that supports CF CLI, but that ability is missing from blueocean. So how should I be able to push the deployments to cloud foundry using Pipleline job.


Thanks,

Sekhar.

James Dumay

unread,
Feb 6, 2017, 1:46:36 AM2/6/17
to Jenkins Users
You will need to customize the Blue Ocean image to contain the cf executable and use your new image instead of the one we provide.

Sekhar Kari

unread,
Feb 8, 2017, 2:40:24 AM2/8/17
to Jenkins Users
Thanks James, I actually did this before. 
When I tried the I see that the volume gets over-written and some how the CF executable is still missing from the new image. Below is my Dockerfile. I see that the curl script downloaded and extracted the cf tool, but there are some intermittent containters being deleted and the final image never had the cf in it. 


#

# Create an image for jenkins blueocean version along with CF CLI installer

#

FROM jenkinsci/blueocean:latest


WORKDIR /var/jenkins_home/

RUN curl -L "https://cli.run.pivotal.io/stable?release=linux64-binary&source=github" | tar -zx

Reply all
Reply to author
Forward
0 new messages