Skip to content

Upgrade prod server

Charles de Beauchesne edited this page Apr 10, 2019 · 7 revisions

Create release on github

Here the steps to release a new UI version on camptocamp.org

First of all, you must create a release on github. Please follow semver logic :

  • minor change, bug fix => increment last number : X.Y.Z >> X.Y.Z+1
  • feature addition => increment middle number : X.Y.Z >> X.Y+1.Z
  • feature deletion, major change => increment first number : X.Y.Z >> X+1.Y.Z

Please add a description, by simply copy-paste the content of this command :

git log --pretty=oneline <last-release-id>..HEAD --no-merges

Then, check that docker image is ready : https://hub.docker.com/r/c2corg/c2c_ui/tags

Upgrade production server

And finally, upgrade the prod server. First of all, open http://camptocamp.org:8008/stats to have a global overview of workers. Then execute this :

# Connect to the composition management server
ssh <user_id>@compose0.exoscale.infra.camptocamp.org

# IMPORTANT : set-up env variables
source /opt/c2corg-docker/server-list.env

# Got to first UI instance
cd /opt/c2corg-docker/composition/production/ui0/

# Update the version on docker-compose.yml
grep image: docker-compose.yml
vi docker-compose.yml

# Set container in mainternance mode (will not get new requests for Haproxy)
docker-compose exec ui touch maintenance_mode.txt

# download the new image
docker-compose pull

# shutdown the running container, and restart it
docker-compose stop && docker-compose rm -f
docker-compose up -d

# make sure everything is working properly
docker-compose ps

# don't forget to save your changes
git add . && git commit

# Perfect ! Let's do the same for ui1
# notice : you do not need to update docker-compose.yml
cd ../ui1
docker-compose exec ui touch maintenance_mode.txt
docker-compose pull
docker-compose stop && docker-compose rm -f
docker-compose up -d
docker-compose ps

Community message

After a small check that everything works as expected on https://www.camptocamp.org, leave a message on https://forum.camptocamp.org/t/annonces-de-mise-a-jour-de-lui/241120. You can simply leave a message with a link to release page on Github, and put your message on wiki mode, if anybody wants to provide a user friendly communication.