Initial support for hotfix integration as outlined in milestone 6. #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a new
/hotfixes
folder in containers and${PERSISTENT_ROOT}/hotfixes
withscripts
andpatches
in it on the host.Adds a simple script to help apply hotfixes from a folder and installs it in
/app/apply-hotfixes.sh
in all containers.All containers bind-mount
${PERSISTENT_ROOT}/hotfixes
on/hotfixes
anddocker-entry.sh
is extended to first run/app/apply-hotfixes.sh
on the mounted/hotfixes
. It traverses it and sequentially applies any patches found in/hotfix/patches/
and runs any scripts found in/hotfix/scripts/
before proceeding with the usual container execution to effectively hot-fix everything inside the container before running.It is tested to work in the development env with a couple of simple
helloworld.sh
andhelloworld2.sh
scripts plus a minimalmotd.patch
. For production use it is recommended to instead use a numbering prefix for explicit ordering in order to assure patches and scripts are run in the expected order. E.g.00-initial-changes.patch
, ...,42-fix-something-else.patch
, ...,99-final-wrap-up.patch
and similar for the scripts.Executed scripts and applied patches get registered in
/tmp
in order to skip them and only run newly added ones ifapply-hotfixes.sh
is re-run inside the containers.NB: scripts need to be executable and patches need to be made with absolute path so that
patch -d / -p 0 < PATCH
will apply them cleanly without interaction.