Create pop-up alert on cpanel.yml error or exit?
Is there a way for me to create a pop-up alert for the logged in user when a deployment via cpanel.yml fails or exits?
I am creating a generic deployment script in cpanel.yml that will read some environment variables from a separate file saved in each repository. When an account owner uses the Deploy HEAD button, and the script fails or exits, I'd like to alert the logged in user that there's a problem.
I know that there are deployment logs at /home/username/.cpanel/logs/
But I'm expecting my users to barely be able to manage clicking the Pull and Deploy HEAD buttons in the Git Repositories area. Asking them to find and dig through the log files is unreasonable. So I want to check their repository environment file for errors and also give them advice when the deployment fails. Currently, deployments fail silently and write errors to the log folder.
Maybe there's an exit code I can apply that will cause cPanel to display a deployment error?
Or maybe there's a UAPI command I can add to a cpanel.yml or shell script to do this?
-
Hey hey! I spoke with the dev team and the only supported end-user notification area we have is the News page:
https://docs.cpanel.net/whm/cpanel/modify-cpanel-whm-news/
You could likely make something that shows up here, but I don't believe there's going to be a way to customize/add a popup for a specific command or action in the UI.
0 -
Got it. Thanks for investigating.
0 -
No, cPanel does not support pop-up alerts, custom UI messages, or UAPI calls from cpanel.yml; the only supported feedback on failure is the deployment status and logs, so your best option is to fail with a clear exit code and write a simple, readable error message to the deploy log (or send an email/Slack notification from the script).
0
Please sign in to leave a comment.
Comments
3 comments