Chapter 11. Webhooks and Build Automation

The support in OpenShift for the Docker and Source build strategies simplifies the build and deployment process, as OpenShift worries about the details of running the steps for you.

When the source code is contained in a hosted Git repository, OpenShift can also automatically trigger a rebuild and new deployment when the S2I builder image, or the base image used for a Docker build, has been updated. This is because it can pull down the last used source code from the Git repository whenever it needs to.

With what you have learned so far, any time you make changes to the source code you will currently still need to manually trigger a new build with the latest source code.

In order to completely automate your development workflow, in this chapter you will learn how to link your Git repository to OpenShift using a webhook. This will allow you to have a new build automatically started on code changes, each time you commit and push those changes to your Git repository.

Because you likely will want to use a private hosted Git repository, where access to your source code is only possible by first supplying appropriate access credentials, this chapter will also look at how to use OpenShift with a private hosted Git repository.

Using a Hosted Git Repository

You’ve seen how to set up the build and deployment of an application from source code, using the web console or oc command-line tool. The build can make use of a Source-to-Image builder, or ...

Get Deploying to OpenShift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.