Skip to content

[Feature request] clear cache and enable maintenance during automatic updates #326

Open

Description

@landure

Currently, the entrypoint run automatic updates with:

php bin/console database:update --no-interaction

To prevent unwanted actions during update, it would be nice to enable maintenance.
And to prevent bug linked to changes in templates, it would be nice to clean the cache.
This would require to detect the docker image version compared to the database and/or cached files version.

php bin/console maintenance:enable --no-interaction

# Migrate database
php bin/console database:update --no-interaction

# Clear caches
php bin/console cache:clear --no-interaction

# Exit maintenance mode
php bin/console maintenance:disable --no-interaction

Activity

  1. landure commented on Oct 6, 2026

    @landure
    Author

    A possible implementation is:

    Update_GLPI() {
        if ! bin/console db:is_up_to_date --no-interaction --quiet; then
            bin/console maintenance:enable --no-interaction --quiet
            bin/console database:update --no-interaction --quiet
            bin/console cache:clear --no-interaction --quiet
            bin/console maintenance:disable --no-interaction --quiet
        fi
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions