Which command sets a post-commit bash-based build hook?

Prepare for the Red Hat OpenShift Developer II DO288 Exam with our quizzes. Study with flashcards and multiple choice questions, each with hints and explanations. Get ready for your certification!

Multiple Choice

Which command sets a post-commit bash-based build hook?

Explanation:
Post-commit hooks run after a BuildConfig build finishes, so they’re used to trigger actions once the build completes. To set such a hook to run a Bash command, you target the specific BuildConfig hook resource (here bc/hook) and specify the hook as post-commit, indicate you’re providing a command, and choose Bash as the shell. The command is then passed with -c "..." to be executed by Bash. This combination creates a post-commit hook that runs your Bash command after the build finishes. Using a pre-commit flag would place the hook before the build starts, not after, which isn’t what you want here. Using a non-Bash shell flag or a different shell flag would not set a Bash-based hook correctly, so those options don’t fit.

Post-commit hooks run after a BuildConfig build finishes, so they’re used to trigger actions once the build completes. To set such a hook to run a Bash command, you target the specific BuildConfig hook resource (here bc/hook) and specify the hook as post-commit, indicate you’re providing a command, and choose Bash as the shell. The command is then passed with -c "..." to be executed by Bash. This combination creates a post-commit hook that runs your Bash command after the build finishes.

Using a pre-commit flag would place the hook before the build starts, not after, which isn’t what you want here. Using a non-Bash shell flag or a different shell flag would not set a Bash-based hook correctly, so those options don’t fit.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy