-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add project-specific startup script support (eg. for cron configuration) #263
base: master
Are you sure you want to change the base?
Add project-specific startup script support (eg. for cron configuration) #263
Conversation
d35d8e5
to
06b3a94
Compare
06b3a94
to
bc65179
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image already allows for adding "custom" scripts, but adding them hard-coded would not work as expected (see specific comment).
As an alternative, which would make more sense and is more flexible, I would add this directly into the Devilbox as an example script. Similar to what has been done here in the autostart/
dir for blackfire and nodejs:
https://github.com/cytopia/devilbox/tree/master/autostart
|
||
for DEVILBOX_PROJECT_DIR in /shared/httpd/*; do | ||
|
||
script_dir=${DEVILBOX_PROJECT_DIR}/.devilbox/autostart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PHP-FPM images are not aware about the .devilbox/
directory. This is specific to the HTTPD images and can also be changed to any other directory:
So hardcoding it here would not work.
In other words, the PHP-FPM images don't know about this path and hardcoding it here would result in it not working, once you change it via the HTTPD images (or in our use-case vie the Devilbox .env
variable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
Would it be an option to propagate the MASS_VHOST_TEMPLATE_DIR
to the PHP-FPM images too and use it in the script? Or create a new variable that defaults to the same directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be an option to propagate the
MASS_VHOST_TEMPLATE_DIR
This would not make much sense, as the PHP images have nothing to do with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The disadvantage of the global autostart directory is that it is not project-specific and hence not distributed with the project code (e.g. via version control). It requires every developer working on the project to run additional installation steps for the project. |
The global autostart (all versions or per version) offers exactly this functionality. You can add any kind of shell script. It is just a generic way to start things up. What you do with it is totally up to the user. What I can think of, is to add some generic template scripts |
bc65179
to
d0e6ea4
Compare
d0e6ea4
to
b75c0eb
Compare
It would still require to deploy the autostart script. With the updated version of the code, the vHost config dir Does that make it better suitable or are you against any built-in support for this (as opposed to the global autostart scripts? |
9b057b5
to
b5c2522
Compare
…ion) Allow user to add *.sh files to `$HOST_PATH_HTTPD_DATADIR/*/$HTTPD_TEMPLATE_DIR/autostart` which will then be executed on startup of the php container.
b5c2522
to
9ab9ae3
Compare
Allow user to add *.sh files to
$HOST_PATH_HTTPD_DATADIR/*/.devilbox/autostart
which will then be executed on startup of the php container.