-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pre-deploy and post-deploy commands + context + runOnlyOnceByOrg #466
Comments
Is it possible to specify if the action is one time/recurring? It would useful to be able to specify that and storing the execution history in custom metadata/settings in each org to determine if it was already executed or not. Also a flag to don’t run them during PR validations. |
@paferpo about one-time / recurring... as sfdx-hardis is stateless, I don't know where to store it :/ About the flag to run them only during deploy validation or effective deployments, I'm working on it with v5, you'll be able to use it soon :) |
Hi Nicolas, as I mentioned in my previous message, it can be stored in custom settings records of each org where you are deploying to and, with a simple query, you can check if the action id was already executed (check only when the action is one-time of course). |
@paferpo I get it, it's just that it would require such custom setting / metadata to be existing before the deployment ^^ |
I can think of 2 options in case it helps: either create the custom setting object + the action record on the fly when it doesn't exist (checking using metadata.list/metadata.read or just a query that will fail when the object does not exist) or, if that's too much work, just show a message saying that to use that option, the custom setting with name x must exist before, when it's not found. |
I don't like the principle of uploading metadatas without the explicit acceptance from the user, so it will be option 2 :) |
This is done in v5 (already tested and available using sf plugins install sfdx-hardis@alpha) See documentation :) I tested it with local test cases, but if you want to also test it and provide feedback it will be highly appreciated :) |
Awesome! I will give a try in my ci/cd setup :) |
Happy to help :) |
Hi Nicolas, I played with it. It works very well :) |
@paferpo glad it works for your use case:) |
@paferpo and please star the repository :) ( and post about it if it's your style ;) ) |
Allow to configure command lines to call before and after a deployment
The text was updated successfully, but these errors were encountered: