Openshift CLI command to start S2I (source to image) build looks like this:
oc start-build buildname --from-dir=./someDirectory--wait=true
But how can we execute some shell command? os start-build is going to create image (described in the build definition) and copy someDirectory to it, but what if we need additional configuration of that image, not only to push compiled source code there?
There're a couple of options:
assemble script override options:
Example of assemble script and s2i workflow you can check in s2i or there's simple example:
In addition, There's postCommit build hooks which executes after commiting the image and before pushing it to the registry. It executes in temporary container so it can only be used to do some tests.