Conversation
…added. They need to be idempotent.
Stosiu
left a comment
There was a problem hiding this comment.
I like this feature a lot! 🎉 I left some of my thoughts about how we can improve the user experience.
README.md
Outdated
| *NOTE*: setup scripts *must* be idempotent (able to run multiple times without adverse effects), as they will run multiple times - on each change to the setup scripts. | ||
|
|
||
| *NOTE 2*: each setup script will be run up to 10 times, with a delay of 3 seconds (determined by it's exit code). | ||
|
|
There was a problem hiding this comment.
Note #1 It's quite an important, IMO. Maybe instead of saying it in a note, we can add it to the description somewhere at the beginning?
Co-Authored-By: Aleksander Stós <aleksander.stos@gmail.com>
…ap into feature/setup
|
@Stosiu Please do dbl. check the rephrased version. Loved your comments. |
Stosiu
left a comment
There was a problem hiding this comment.
The code looks good and I like the rephrased text!
I left some more thoughts about the new texts but don't be bothered about them that much if you think that they don't make much sense (they are my personal preferences rather than an objective point of view arguments).
The only thing to fix is a typo in line 46 in README.md: accomodate -> accommodate.
README.md
Outdated
| ## Services pre-run setup | ||
| Some services will need to perform a certain set of actions before they are able to start successfully. This might include eg. running migrations, setting up fixtures, etc. | ||
|
|
||
| To accomodate this, this script will run all the setup scripts, every time they change since the last setup run (as per last git modification timestamp). |
There was a problem hiding this comment.
I always feel weird reading docs written this way 😅 this script will run all the setup scripts well okay, but at this point in the text I have no clue how to set them up, how they should look like or even if they already exist or not.
There was a problem hiding this comment.
I prefere aproches like:
Some services will need to perform a certain set of actions before they are able to start successfully. This might include eg. running migrations, setting up fixtures, etc.
To accommodate this, create a ./setup directory with .sh files you would like to run. Scripts are executed in alphabetical order as per bash. Scripts will run every time they change since the last setup run (as per last git modification timestamp).
Example setup scripts initialization
mkdir -p ./setup
touch ./setup/initialize-database.sh(...)
|
|
||
| Setup step will run right after `up` command. | ||
|
|
||
| Setup can be forced (regardless of the timestamps) by running: |
There was a problem hiding this comment.
Side note: While reading this I asked myself if this updates timestamp and it does.
Co-Authored-By: Aleksander Stós <aleksander.stos@gmail.com>
No description provided.