~qeef/damn-deploy

2857bfef730842ab984c4b2046d4a0417e3c9d4a — Jiri Vlasak 3 months ago 5a5bccd
Add upgrade to v0.8.0 section
1 files changed, 67 insertions(+), 0 deletions(-)

M README.md
M README.md => README.md +67 -0
@@ 232,6 232,73 @@ Run the update query:

    update current_commits set type='splitted' where message='The square was splitted';

Upgrade to `v0.8.0`
-------------------

This upgrade introduce change of the repository source and directories
renaming. The best is to stop the running service first:

    systemctl stop damn.service

Make sure all the containers are stopped:

    cd damn_deploy
    docker-compose -f docker-compose.yml stop
    docker-compose -f docker-compose-clients.yml stop
    docker-compose -f docker-compose-chat.yml stop
    cd ..

And then follow the *How to deploy* section (I assume the current directory is
`/root/`:)

    git clone https://git.sr.ht/~qeef/damn-deploy
    cd damn-deploy

Then copy secrets and configuration from `../damn_deploy/.env` to `.env` file.
(The `.env` changed a bit!) Also, update `traefik.yml` and copy
`../damn_deploy/acme.json` to `acme.json`.

The next step is to rewrite systemd config files. From the *Autostart with
`systemd`* section, run the command to *Create systemd unit for
`docker-compose`*:

    cat << EOF > /etc/systemd/system/damn.service
    ...

And from the *Damn upkeep* section, run the command to *Create systemd unit and
timer for damn upkeep*:

    cat << EOF > /etc/systemd/system/damn_upkeep.service
    ...

Rebuild all the docker images with:

    docker-compose -f server.yml build --no-cache api
    docker-compose -f server.yml build --no-cache upkeep
    docker-compose -f clients.yml build --no-cache client
    docker-compose -f clients.yml build --no-cache manager
    docker-compose -f chat.yml build --no-cache chat

Copy old database volume to the new database volume:

    docker volume create --name damn-deploy_damndb-volume
    docker run --rm -v damn_deploy_damndb-volume:/from -v damn-deploy_damndb-volume:/to alpine ash -c 'cd /from ; cp -av . /to'

Remove `damndb` container and rebuild it. It does **nothing** to the database.

    docker rm damndb
    docker-compose -f server.yml build --no-cache db

Reload systemd units and start the service:

    systemctl daemon-reload
    systemctl start damn.service

Now, if everything works and everything is tested, you may remove old database
volume:

    docker volume rm damn_deploy_damndb-volume


Damn upkeep
===========