Which command configures a post-commit build hook to run a command (bundle exec rake test --verbose) for a BuildConfig named "name"?

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 configures a post-commit build hook to run a command (bundle exec rake test --verbose) for a BuildConfig named "name"?

Explanation:
Configuring a post-commit build hook on a BuildConfig uses a specific syntax to ensure the hook runs the intended command correctly. The correct approach targets the BuildConfig named name, selects the post-commit hook, and passes the exact command to run. The key is using --command and then a separate -- to mark the end of the oc options so the shell command bundle exec rake test --verbose is treated as a single command string. This ensures the command is parsed correctly and executed as the hook, not as additional oc flags. So the proper command is: oc set build-hook bc/name --post-commit --command -- bundle exec rake test --verbose This distinguishes the post-commit hook, indicates a command should be run, and provides the full command with proper spacing. The other options either specify a different hook type, omit the necessary separator after --command, or use a different form (--script) that isn’t aligned with this exact invocation.

Configuring a post-commit build hook on a BuildConfig uses a specific syntax to ensure the hook runs the intended command correctly. The correct approach targets the BuildConfig named name, selects the post-commit hook, and passes the exact command to run. The key is using --command and then a separate -- to mark the end of the oc options so the shell command bundle exec rake test --verbose is treated as a single command string. This ensures the command is parsed correctly and executed as the hook, not as additional oc flags.

So the proper command is: oc set build-hook bc/name --post-commit --command -- bundle exec rake test --verbose

This distinguishes the post-commit hook, indicates a command should be run, and provides the full command with proper spacing. The other options either specify a different hook type, omit the necessary separator after --command, or use a different form (--script) that isn’t aligned with this exact invocation.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy