From 5f1a76042fd1cb5f89bb1395f42901f656aea8fb Mon Sep 17 00:00:00 2001 From: Randy Barlow Date: Mar 22 2019 20:55:53 +0000 Subject: Add more detail to Bodhi's SOP regarding building and OpenShift. This commit adds more details about how to specify which version of Bodhi gets deployed to OpenShift, since we don't just build the latest version found in the infrastructure repository. It also describes how to build Bodhi for the f29-infra and f29-infra-stg repositories. Signed-off-by: Randy Barlow --- diff --git a/docs/sysadmin-guide/sops/bodhi.rst b/docs/sysadmin-guide/sops/bodhi.rst index 0085f23..417bf21 100644 --- a/docs/sysadmin-guide/sops/bodhi.rst +++ b/docs/sysadmin-guide/sops/bodhi.rst @@ -183,6 +183,33 @@ If a push fails for some reason, you can easily resume it on ``bodhi-backend01`` Performing a bodhi upgrade =========================== +Build Bodhi +----------- + +Bodhi is deployed from the infrastructure Koji repositories. At the time of this writing, it is +deployed from the ``f29-infra`` and ``f29-infra-stg`` (for staging) repositories. Bodhi is built +for these repositories from the ``master`` branch of the `bodhi dist-git repository`_. + +As an example, to build a Bodhi beta for the ``f29-infra-stg`` repository, you can use this +command:: + + $ rpmbuild --define "dist .fc29.infra" -bs bodhi.spec + Wrote: /home/bowlofeggs/rpmbuild/SRPMS/bodhi-3.13.0-0.0.beta.e0ca5bc.fc29.infra.src.rpm + $ koji build f29-infra /home/bowlofeggs/rpmbuild/SRPMS/bodhi-3.13.0-0.0.beta.e0ca5bc.fc29.infra.src.rpm + +When building a Bodhi release that is intended for production, we should build from the production +dist-git repo instead of uploading an SRPM:: + + $ koji build f29-infra git+https://src.fedoraproject.org/rpms/bodhi.git#d64f40408876ec85663ec52888c4e44d92614b37 + +All builds against the ``f29-infra`` build target will go into the ``f29-infra-stg`` repository. If +you wish to promote a build from staging to production, you can do something like this command:: + + $ koji move-build f29-infra-stg f29-infra bodhi-3.13.0-1.fc29.infra + +.. _bodhi dist-git repository: https://src.fedoraproject.org/rpms/bodhi + + Staging ------- @@ -192,6 +219,18 @@ If you are in this situation, you can apply those changes by running the bodhi-b sudo rbac-playbook -l staging groups/bodhi-backend.yml +In `Bodhi's OpenShift playbook`_, edit the ``bodhi_version`` variable for the block that has the +``when env == "staging"`` condition, set it to the version you wish to deploy to staging, and commit +the change to the Infrastructure Ansible repository. For example, to deploy +``bodhi-3.13.0-0.0.beta.e0ca5bc.fc29.infra`` to staging, I would set that block like this:: + + - role: openshift/object + app: bodhi + template: buildconfig.yml + objectname: buildconfig.yml + bodhi_version: bodhi-3.13.0-0.0.beta.e0ca5bc.fc29.infra + when: env == "staging" + Run these commands:: # Synchronize the database from production to staging @@ -202,6 +241,8 @@ Run these commands:: $ sudo rbac-playbook openshift-apps/bodhi.yml -l staging +.. _Bodhi's OpenShift playbook: https://infrastructure.fedoraproject.org/cgit/ansible.git/tree/playbooks/openshift-apps/bodhi.yml + Production ---------- @@ -211,6 +252,18 @@ If you are in this situation, you can apply those changes by running the bodhi-b sudo rbac-playbook groups/bodhi-backend.yml -l bodhi-backend +In `Bodhi's OpenShift playbook`_, edit the ``bodhi_version`` variable for the block that has the +``when env != "staging"`` condition, set it to the version you wish to deploy to production, and +commit the change to the Infrastructure Ansible repository. For example, to deploy +``bodhi-3.13.0-1.fc29.infra`` to staging, I would set that block like this:: + + - role: openshift/object + app: bodhi + template: buildconfig.yml + objectname: buildconfig.yml + bodhi_version: bodhi-3.13.0-1.fc29.infra + when: env != "staging" + To update the bodhi RPMs in production:: # Update the backend VMs (this will also run the migrations, if any)