devilbox/docs/getting-started/update-the-devilbox.rst

124 lines
3.2 KiB
ReStructuredText
Raw Normal View History

2018-03-11 11:26:03 +01:00
*******************
Update the Devilbox
*******************
2018-03-11 12:33:54 +01:00
If you are in the initial install process, you can safely skip this section and come back once
you actually want to update the Devilbox.
2018-03-11 11:26:03 +01:00
Update git repository
=====================
2018-03-11 12:33:54 +01:00
Stop container
--------------
Before updating your git branch or checking out a different tag or commit, make sure to properly
stop all devilbox containers:
.. code-block:: bash
# Stop containers
2018-03-11 14:57:10 +01:00
host> cd path/to/devilbox
host> docker-compose stop
2018-03-11 12:33:54 +01:00
# Ensure containers are stopped
2018-03-11 14:57:10 +01:00
host> docker-compse ps
2018-03-11 12:33:54 +01:00
Case 1: Update master branch
----------------------------
If you simply want to update the master branch, do a ``git pull origin master``:
.. code-block:: bash
# Update master branch
2018-03-11 14:57:10 +01:00
host> cd path/to/devilbox
host> git pull origin master
2018-03-11 12:33:54 +01:00
Case 2: Checkout release tag
----------------------------
If you want to checkout a specific release tag (such as ``0.12.1``), do a ``git checkout 0.12.1``:
.. code-block:: bash
# Checkout release
2018-03-11 14:57:10 +01:00
host> cd path/to/devilbox
host> git checkout 0.12.1
2018-03-11 12:33:54 +01:00
Keep ``.env`` file in sync
--------------------------
2018-03-11 11:26:03 +01:00
.. warning::
Whenever you check out a different version, make sure that your ``.env`` file is up-to-date
with the bundled ``env-example`` file. Different Devilbox releases might require different
settings to be available inside the ``.env`` file.
You can also compare your current ``.env`` file with the provided ``env-example`` file by using
your favorite diff editor:
2018-03-11 12:33:54 +01:00
.. code-block:: bash
2018-03-11 11:26:03 +01:00
2018-03-11 14:57:10 +01:00
host> vimdiff .env env-example
2018-03-11 11:26:03 +01:00
2018-03-11 12:33:54 +01:00
.. code-block:: bash
2018-03-11 11:26:03 +01:00
2018-03-11 14:57:10 +01:00
host> diff .env env-example
2018-03-11 11:26:03 +01:00
2018-03-11 12:33:54 +01:00
.. code-block:: bash
2018-03-11 11:26:03 +01:00
2018-03-11 14:57:10 +01:00
host> meld .env env-example
2018-03-11 11:26:03 +01:00
2018-03-11 12:33:54 +01:00
Update Docker container
=======================
2018-03-11 11:26:03 +01:00
2018-03-11 12:33:54 +01:00
Updating the git branch shouldn't be needed to often, most changes are actually shipped via newer
``Docker images``, so you should frequently update those.
2018-03-11 11:26:03 +01:00
2018-03-11 12:33:54 +01:00
This is usually achieved by issueing a ``docker pull`` command with the correct image name and image
version. For your convenience there is a shell script in the Devilbox git directory: ``update-docker.sh``
which will update all available Docker images at once.
.. code-block:: bash
# Update docker images
2018-03-11 14:57:10 +01:00
host> cd path/to/devilbox
host> ./update-docker.sh
2018-03-11 12:33:54 +01:00
.. note::
The Devilbox own Docker images (Apache, Nginx, PHP and MySQL) are even built every night to ensure
latest security patches and tool versions are applied.
Remove anonymous volumes
========================
The devilbox is not yet at a feature-ready stable release and volumes mounts might change from release to release until version 1.0 will be released. This can cause errors during startup. To solve those issues after updating, you should remove all anonymouse volumes with the following command:
.. code-block:: bash
# Remove anonymous volumes
2018-03-11 14:57:10 +01:00
host> cd path/to/devilbox
host> docker-compose rm
2018-03-11 12:33:54 +01:00
Checklist git repository
========================
1. Ensure containers are stopped
2. Ensure desired branch, tag or commit is checked out or latest changes are pulled
3. Ensure ``.env`` file is in sync with ``env-example`` file
4. Ensure anonymous volumes are removed
Checklist Docker images
2018-03-11 11:26:03 +01:00
=======================
2018-03-11 12:33:54 +01:00
1. Ensure ``./update-docker.sh`` is executed
2. Ensure anonymous volumes are removed