2019-01-08 11:58:40 -05:00
|
|
|
// Module included in the following assemblies:
|
|
|
|
|
//
|
2020-06-10 11:18:10 -04:00
|
|
|
// * builds/triggering-builds-build-hooks.adoc
|
2019-01-08 11:58:40 -05:00
|
|
|
|
2022-02-04 15:22:10 +00:00
|
|
|
:_content-type: PROCEDURE
|
2019-05-13 08:55:00 +10:00
|
|
|
[id="builds-using-cli-post-commit-build-hooks_{context}"]
|
2019-01-08 11:58:40 -05:00
|
|
|
= Using the CLI to set post commit build hooks
|
|
|
|
|
|
2020-08-06 13:15:31 -04:00
|
|
|
The `oc set build-hook` command can be used to set the build hook for a build configuration.
|
2019-01-08 11:58:40 -05:00
|
|
|
|
|
|
|
|
.Procedure
|
|
|
|
|
|
|
|
|
|
. To set a command as the post-commit build hook:
|
|
|
|
|
+
|
2020-08-06 13:15:31 -04:00
|
|
|
[source,terminal]
|
2019-01-08 11:58:40 -05:00
|
|
|
----
|
|
|
|
|
$ oc set build-hook bc/mybc \
|
|
|
|
|
--post-commit \
|
|
|
|
|
--command \
|
|
|
|
|
-- bundle exec rake test --verbose
|
|
|
|
|
----
|
|
|
|
|
+
|
|
|
|
|
. To set a script as the post-commit build hook:
|
|
|
|
|
+
|
2020-08-06 13:15:31 -04:00
|
|
|
[source,terminal]
|
2019-01-08 11:58:40 -05:00
|
|
|
----
|
|
|
|
|
$ oc set build-hook bc/mybc --post-commit --script="bundle exec rake test --verbose"
|
|
|
|
|
----
|