-
Notifications
You must be signed in to change notification settings - Fork 6
Improve handling of the _installing file #747
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
Conversation
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.
Nice, looks good 👍 Added a comment tho, please see if it's valid.
|
||
# Attempt to remove the _installing file at the very beginning, ignoring errors if it doesn't exist. | ||
# This cleans up state from a potential previous failed install run. | ||
rm -f "$INSTALLING_FILE" |
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.
Should we add || true
also here to prevent potential erroring out? :)
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.
@k4lv15 the -f
takes care of that, it does not fail even if the file does not exist :)
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.
Ahh, okays, just noticed it's added in the other place: https://github.com/wunderio/drupal-project-k8s/pull/747/files#diff-c4f491ae4ef2d83e98019bc3ac28e9ba383d1ec3573c7f25e65e1871f0f13821R436
Was wondering if we need it here as well. If not, all good then!
This pull request refactors the handling of the
_installing
file in thecharts/drupal/templates/_helpers.tpl
file to improve maintainability and ensure consistent behavior across multiple commands. The changes centralize the definition of the_installing
file path, replace hardcoded paths with a reusable template, and add safeguards for file removal operations.Motivation
rm
command errors out and fails the whole deploymentRefactoring
_installing
File Handling:drupal.installing-file
to centralize the definition of the_installing
file path, replacing hardcoded paths throughout the file.drupal.installation-in-progress-test
definition to use the newdrupal.installing-file
template for consistency.Improvements to File Operations:
_installing
file at the beginning of thedrupal.data-pull-command
anddrupal.post-release-command
definitions, ignoring errors if the file does not exist, to clean up state from potential previous failed runs. [1] [2]rm
andtouch
operations with variables referencing thedrupal.installing-file
template for better maintainability and readability. [1] [2] [3]