-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
move init-file processing into a function #402
move init-file processing into a function #402
Conversation
files found within /docker-entrypoint-initdb.d/* are processed using specific rules based on their filename. It was previously difficult to re-use this logic recursively, or to add logic for handling additional filetypes. By moving this logic into a shell function, we both enable inner shell scripts to easily re-use the same logic (for example, for including files from additional directories or sub-directories), and the possibility of overriding these processing rules entirely, for example to enable handling of additional filename patterns. There is a potential change of functionality compared to the previous version: the mysql command can no-longer be overridden by changing the mysql variable. Instead, the mysql command may be overridden only by overriding the process_init_file() function. There is a potentially loss of functionality in that included scripts can no-longer use "break" to escape the file loop. There is presently no work-around for this, as this is not expected to have been an intended feature.
though automated travis-ci has failed, (if I am reading the log correctly) these failures appear to be unrelated to the requested change. |
I am reopening after having caused a successful travis build based on my own repository ( no changes required - the issue appears to be a known instability in ha.pool.sks-keyservers.net , which is not involved in this pull request's changes ) |
I'm +1 on this, as compartmentalizing the different sections of the entrypoint script will in general make it easier to debug and make improvements |
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.
Thanks @ltangvald ❤️
LGTM 👍
- `buildpack-deps`: add `netbase` - `gcc`: 8.1.0 - `ghost`: 1.22.5, 0.11.13 - `haproxy`: 1.7.11 - `mariadb`: 10.0.35 - `mongo`: 3.7.9 - `mysql`: docker-library/mysql#402 - `openjdk`: 11-ea-11, 8u171 - `php`: docker-library/php#627, docker-library/php#632 - `pypy`: docker-library/pypy#23 - `python`: add `netbase`, 3.7.0b4 - `rabbitmq`: 3.7.5-rc.1 - `rocket.chat`: 0.64.1
I have often found myself deriving the mysql image in order to make
it easier to process initialisation files in multiple paths, or to change
the rules used for processing such initialisation files. After having
made such extensions repeatedly, I have now attempted to clean
them up and make them generic enough for inclusion into the
upstream repository.
files found within /docker-entrypoint-initdb.d/* are processed using
specific rules based on their filename. It was previously difficult to
re-use this logic recursively, or to add logic for handling additional
filetypes.
By moving this logic into a shell function, we both enable inner shell
scripts to easily re-use the same logic (for example, for including
files from additional directories or sub-directories), and the
possibility of overriding these processing rules entirely, for example
to enable handling of additional filename patterns.
There is a potential change of functionality compared to the previous
version: the mysql command can no-longer be overridden by changing the
mysql variable. Instead, the mysql command may be overridden only by
overriding the process_init_file() function.
There is a potentially loss of functionality in that included scripts
can no-longer use "break" to escape the file loop. There is presently
no work-around for this, as this is not expected to have been an
intended feature.