Description of problem:
In 4.0 postcommit are not support args, refer, so should not set the post-commit hook as a set of arguments to the default image entrypoint
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.oc set build-hook bc/ruby-hello-world --post-commit --help
# Set the post-commit hook as a set of arguments to the default image entrypoint
oc set build-hook bc/mybuild --post-commit -- arg1 arg2
oc set build-hook bc/ruby-hello-world --post-commit -- arg1 arg2
display oc set build-hook bc/mybuild --post-commit -- arg1 arg2
should delete the info in help, and when execute the command should give error info
Opened pull request https://github.com/openshift/origin/pull/21880 to address this issue
Pull request has merged.
Checked in version
oc set build-hook bc/ruby-sample-build --post-commit --help
# Clear post-commit hook on a build config
oc set build-hook bc/mybuild --post-commit --remove
# Set the post-commit hook to execute a test suite using a new entrypoint
oc set build-hook bc/mybuild --post-commit --command -- /bin/bash -c /var/lib/test-image.sh
# Set the post-commit hook to execute a shell script
oc set build-hook bc/mybuild --post-commit --script="/var/lib/test-image.sh param1 param2 && /var/lib/done.sh"
and tested it with script, build complete. verified the bug
$ oc set build-hook bc/ruby-sample-build --post-commit --script="bundle exec rake test" -n wewang3
[wewang@Desktop ~]$ oc get builds -n wewang3 --watch
NAME TYPE FROM STATUS STARTED DURATION
ruby-sample-build-1 Source Git@787f1be Complete 14 minutes ago 1m51s
ruby-sample-build-2 Source Git@787f1be Complete 9 minutes ago 2m32s
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.