-
Notifications
You must be signed in to change notification settings - Fork 2
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
Rethink pre/post deploy actions #106
Comments
Splitting files this way could improve readability of each snippet. But... Define complicated? What is the longest file you have? Is it that bad? How often does it happen? There is one layer missing from what i see in your example. It's the conditionality per environment. You could have your environment as a folder layer The other way to introduce this env layer could be within the snippet itself to evaluate the environment and add conditions. Both techniques would have the same issue, how do i easily embrace an overview of the steps executed for a given env? Which is in my opinion what matters in the end. A thing that could be changed though in the current model, is to factorize fragments that are repeated on multiple environments by the usage of functions. Instead of having:
We could have:
(It's on purpose a verbose example, we could use groups in this special use case :D) |
The longest I had was 200+ lines, mostly duplicated (triplicated ^^). The functions approach would reduce the size but I don't feel it's as effective as separate files. In most projects now, we have not only conditions on environment but also on build mode or even on other parameters. This big Splitting this in multiple files have many advantages:
and only a few disadvantages:
Upgrading to this new system could be quite easy because nothing would forbid to still use the current |
We currently have one script for predeploy actions and another for postdeploy and they can become quite complicated on real projects so they become hard to maintain.
It might be easier to get a collection of scripts for each of these "hooks". Combawa could run all scripts in a given directory instead of only run one shell file. Scripts would be ran in the alphabetical order, so devs could use some ordering like it's done in PHP configuration by prefixing the script name by a number (20-mything.sh).
This way, actions could be split in smaller chunks and each of them could have its own conditions inside instead of relying on the general structure of our templates.
We would have that kind of structure
And scripts could look like this
or
or ;)
The text was updated successfully, but these errors were encountered: