Which command configures a post-commit hook on the build config phptest to run bundle exec rake test --verbose?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

Which command configures a post-commit hook on the build config phptest to run bundle exec rake test --verbose?

Explanation:
Configuring build hooks lets you run tasks at specific stages of a build, and a post-commit hook runs after the build has been committed. To set this up, you target the BuildConfig with oc set build-hook, specify the hook type with --post-commit, and provide what to run with --command (not --script) followed by the command and its arguments. Here, you want to execute bundle exec rake test --verbose as the test step, so the correct command is oc set build-hook bc/phptest --post-commit --command -- bundle exec rake test --verbose. Using the pre-commit option would run before the commit, which is not the requested timing. Using --script would treat the input as a script block instead of a direct command, and omitting --verbose would not match the specified command.

Configuring build hooks lets you run tasks at specific stages of a build, and a post-commit hook runs after the build has been committed. To set this up, you target the BuildConfig with oc set build-hook, specify the hook type with --post-commit, and provide what to run with --command (not --script) followed by the command and its arguments. Here, you want to execute bundle exec rake test --verbose as the test step, so the correct command is oc set build-hook bc/phptest --post-commit --command -- bundle exec rake test --verbose. Using the pre-commit option would run before the commit, which is not the requested timing. Using --script would treat the input as a script block instead of a direct command, and omitting --verbose would not match the specified command.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy