Search code examples
devopsopenshift-originopenshift-enterprise

OpenShift S2I build strategy from multiple data sources


A web application typically consists of code, config and data. Code can often be made open source on GitHub. But per-instance config and data may contain secretes therefore are inappropriate be saved in GH. Data can be imported to a persistent storage so disregard for now.

Assuming the configs are file based and are saved in another private secured SVN repo, in order to deploy the web app to OpenShift and implement CI, I need to merge config files with code prior to running build scripts. In addition, the build strategy should support GH webhooks for automated build.

My questions are, to be more specific:

  1. Does OS BuildConfig support multiple data sources, especially from svn?
  2. If not, how to deploy such web app to OS?

Solution

  • The solution I came up with so far:

    1. Instead of relying on OS for CI, use Jenkin instead.
    2. Merge config files with code using Jenkins.
    3. Instead of using Git source type in BuildConfig, use binary source instead
    4. Let jenkins run oc start-build --from-dir=<directory> where <directory> contains merged code/config