From 0302b6e724d0bdca8c95b1392437c976cc4fa5de Mon Sep 17 00:00:00 2001 From: Clement Verna Date: Feb 08 2019 16:36:34 +0000 Subject: Update FPDC with GitHub branch info for automatic deployment Signed-off-by: Clement Verna --- diff --git a/docs/sysadmin-guide/sops/fpdc.rst b/docs/sysadmin-guide/sops/fpdc.rst index 28c5213..7cb9bfc 100644 --- a/docs/sysadmin-guide/sops/fpdc.rst +++ b/docs/sysadmin-guide/sops/fpdc.rst @@ -43,14 +43,25 @@ Systems FPDC is built using the DJANGO REST FRAMEWORK and uses a POSTGRESQL database to store the metadata. The application is run on Openshift and uses the Source-to-image technology to build the container directly from the `git repository `_. -In the staging environment the appplication is automatically rebuilt for every new commit in the master branch, -this is achieved by configuring the github webhook's to trigger an openshift deployment. +In the staging and production environments, the application is automatically rebuilt for every new commit in the `staging` or `production` branch, +this is achieved by configuring a github webhook's to trigger an openshift deployment. -The production deployment is currently manual and is done using the following ansible playbook :: +For example a new deployment to staging would look like that: - sudo rbac-playbook openshift-apps/fpdc.yml -l os-masters + git clone git@github.com:fedora-infra/fpdc.git + cd fpdc + git checkout staging + git rebase master + git push origin staging + +The initial Openshift project deployment is manual and is done using the following ansible playbook :: + + sudo rbac-playbook openshift-apps/fpdc.yml + +This will create a new fpdc project in Openshift with all the needed configuration. + Logs ==== @@ -60,7 +71,7 @@ Logs can be retrive using the openshift command line:: You must obtain an API token by visiting https://os.fedoraproject.org/oauth/token/request $ oc login os-master01.phx2.fedoraproject.org --token= - $ oc get pods + $ oc -n fpdc get pods fpdc-28-bfj52 1/1 Running 522 28d $ oc logs fpdc-28-bfj52 @@ -81,13 +92,13 @@ Hopefully not much. If something goes wrong is it currently advised to kill the You must obtain an API token by visiting https://os.fedoraproject.org/oauth/token/request $ oc login os-master01.phx2.fedoraproject.org --token= - $ oc get pods + $ oc -n fpdc get pods fpdc-28-bfj52 1/1 Running 522 28d $ oc delete pod fpdc-28-bfj52 It is also possible to rollback to a previous version :: - $ oc get dc + $ oc -n fpdc get dc NAME REVISION DESIRED CURRENT TRIGGERED BY fpdc 39 1 1 config,image(fpdc:latest) - $ oc rollback fpdc + $ oc -n fpdc rollback fpdc