1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/builds-using-cli-post-commit-build-hooks.adoc
2023-10-30 10:13:25 -04:00

29 lines
697 B
Plaintext

// Module included in the following assemblies:
//
// * builds/triggering-builds-build-hooks.adoc
:_mod-docs-content-type: PROCEDURE
[id="builds-using-cli-post-commit-build-hooks_{context}"]
= Using the CLI to set post commit build hooks
The `oc set build-hook` command can be used to set the build hook for a build configuration.
.Procedure
. To set a command as the post-commit build hook:
+
[source,terminal]
----
$ oc set build-hook bc/mybc \
--post-commit \
--command \
-- bundle exec rake test --verbose
----
+
. To set a script as the post-commit build hook:
+
[source,terminal]
----
$ oc set build-hook bc/mybc --post-commit --script="bundle exec rake test --verbose"
----