DevOps SAP Cloud-Foundry with Concourse CI/CD
Cloud Foundry is an open source, industry standard Platforms as a Service (PaaS) technology for developing and deploying cloud applications in both private and public cloud environments.
SAP Cloud Platform has adopted the open source Cloud Foundry technology as part of its portfolio, and provides services around SAP Cloud Platform so that customers and enterprises can leverage the power of Cloud Foundry for cloud-native development.
Concourse on the other hand in CI/CD tool, and is pretty popular in the Cloud Foundry universe . https://blog.concourse-ci.org/the-concourse-crew–2017-/ will give you a fair understanding on how concourse came into existence. If you are developing in CF, Concourse is the way to go.
Each step in concourse build is executed inside a container, which means we need a docker for the build of the same. Concourse has an already defined resource called cf (https://github.com/cloudfoundry-community/cf-resource) which can be used in your pipelines. The cf-resource works well, but would not handle lots of stuff a normal devops would be requiring. https://github.com/nulldriver/cf-cli-resource is a good docker-image resource, which pretty much covers all the functionality provided by cf
Though SAP Cloud Foundry is based on open-source cloudfoundry, they heavily rely on a multi-apps plugin (https://github.com/cloudfoundry-incubator/multiapps-cli-plugin). The core idea is to deploy Multi-Target Applications which will be compiled and split into CF apps and services deployed by CF MTA.
We have modified the cf-cli-resource and built our own docker image to accomodate Multiapps . We also need to use Cloud MTA Build, which would take an MTA file and build the Multi Target Archive (MTAR File)
https://github.com/cosmo83/cf-cli-resource/ is the resource repo, and the docker build is already provided at cosmo83/cf-cli-resource.
Please find a sample pipeline
--- resource_types: - name: cf-cli-resource type: docker-image source: repository: cosmo83/cf-cli-resource tag: latest resources: - name: testproj type: git source: uri: https://github.com/cosmo83/testproj branch: master - name: cf-env type: cf-cli-resource source: api: https://api.cf.eu10.hana.ondemand.com username: <Your CF Username> password: <Your CF Password> org: <Your CF Org> space: <Your CF Space> skip_cert_check: false jobs: - name: cfupload plan: - get: testproj trigger: true - put: resource-deploy-mta-app resource: cf-env params: command: deploy mta_file: testproj/mta.yaml - put: cf-bind-service resource: cf-env params: command: bind-service app_name: ui service_instance: mydest
The view of the pipeline from concourse GITHUB Fetch Task MBT Build Task MBT Build Completed ... CF Push to your tenant CF Push completes... CF Bind Task