Hi
I have a perl script that launches a scan of the built artifacts for security vulnerabilities that is included in the git repo which is used as the source for the s2i image build. How do I set it up as a post-commit build hook using OC cli?
The script name is security_scan.pl
Any assistance will be helpful.
Thanks
@WhiskeyRaider I think using "oc set build-hook" will be helpful.
In your case something like below:
oc set build-hook bc/mybc --post-commit --command -- /bin/bash -c 'perl /path/to/your/script.pl'
@WhiskeyRaider Thanks for reaching out!
You can refer this for more details :
Make sure the script is executable ( chmod u+x ) and then place it under the repo directory where it will be cloned fr the S2I build.
For perl script you can use : --command="perl /pathtoscript.pl [arguments]"
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.