OpenShift 2 Flashcards
Two type of bc triggers
Image change triggers
Webhook triggers
How do you view the triggers associated with a build configuration
oc describe bc/name
Add an image change trigger to a build
oc set triggers bc/name –from-image=project/image:tag
How do you remove an image change trigger from a bc
oc set triggers bc/name –from-image=project/image:tag –remove
Add a webhook to a bc
oc set triggers bc/name –from-gitlab
oc set triggers bc/name –from-github
oc set triggers bc/name –from-bitbucket
Remove a webhook from a bc
oc set triggers bc/name –from-gitlab –remove
oc set triggers bc/name –from-github –remove
oc set triggers bc/name –from-bitbucket –remove
What are the two types of post commit hooks?
Command: A executed using the exec system call.
Shell script: Runs a build hook with the /bin/sh -ic command
Create a command post-commit build hook
oc set build-hook bc/name –post-commit \
–command – bundle exec rake test –verbose
Create a shell script post-commit build hook
oc set build-hook bc/name –post-commit \
–script=”curl http://api.com/user/${USER}”
How do you tell S2I where to find its mandatory scripts (run, assemble)
Set io.openshift.s2i.scripts-url as label in the builder image
Ways to customize the s2i script:
1) override the default S2I scripts by providing your own S2I scripts in the .s2i/bin
2) create a wrapper script that invokes the default scripts, and then adds the necessary customization before or after the invocation
using skopeo how do you determine the location of the s2i script for rhscl/php-73-rhel7 S2I builder image
skopeo inspect
docker://myregistry.com/rhscl/php-73-rhel7 | grep io.openshift.s2i.scripts-url
Command for skafolding s2i builder image
s2i create image_name directory
How do yous pecify the maven repo URL when creating an app?
–build-env MAVEN_MIRROR_URL=${URL}
How to specify a build env variable?
–build-env ENV_VAR_NAME=VALUE
Do not put a space after the environment variable ENV_VAR_NAME=VALUE. The environment variable follows the NAME=VALUE format.