SekharKari
SekharKari

Reputation: 521

Jenkins Pipeline - Enabling Cloudfoundry deployment

Installed Blue Ocean 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 compatible CF CLI plug-in the script command CF is not working. And I tried different things:

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 heard Cloudbees has a commercial version that supports CF CLI, but that ability is missing from Blue ocean. So how should I be able to push the deployments to cloud foundry using Pipeline job?

Upvotes: 2

Views: 4170

Answers (1)

kevmando
kevmando

Reputation: 1137

I'm not sure whether you already fixed the issue, but I just installed 'cf cli' on jenkins machine by manual and use 'cf push' as shell script like;

sh 'cf login -u xxx - p xxx -s space -o org'
sh 'cf push appname ...'

Upvotes: 1

Related Questions