Operator or developer requires executing Clound Foundry CLI commands from within a Concourse task & pipeline.
Guidelines for using CF CLI executable in Concourse & Platform Automation.
There are multiple options for executing CF CLI commands in a Concourse task -
jobs:
- name: deploy-app
plan:
- get: app-code
trigger: true
- task: push-to-cf
config:
platform: linux
image_resource:
type: registry-image
source:
repository: cloudfoundry/cli
tag: latest
inputs:
- name: app-code
run:
path: /bin/sh
args:
- -c
- |
cf api ((cf-api-url)) --skip-cert-check
cf auth ((cf-username)) ((cf-password))
cf target -o ((cf-org)) -s ((cf-space))
cd app-code
cf push APP-NAME
FROM ubuntu:jammy
RUN apt-get update -y
RUN apt-get install jq curl wget openssh-client zip git -y
# om cli
RUN curl -L -O https://github.com/pivotal-cf/om/releases/download/7.12.0/om-linux-amd64-7.12.0 -k
RUN mv om-linux-amd64-7.12.0 /usr/local/bin/om
RUN chmod +x /usr/local/bin/om
# cf cli
RUN wget -O cf.tgz "https://packages.cloudfoundry.org/stable?release=linux64-binary&version=8.7.10&source=github-rel" --no-check-certificate
RUN tar -xzvf cf.tgz
RUN mv cf8 /usr/local/bin/cf
RUN chmod +x /usr/local/bin/cf