Reputation: 18443
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?
Upvotes: 0
Views: 2009
Reputation: 511
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:
#!/bin/bash
# Run additional build before steps
# Execute original assemble script.
/usr/libexec/s2i/assemble
# Run additional build after steps
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.
Upvotes: 1