Container: Deploying an Application - Rolling Back and Deployment Triggers

Overview

OpenShift Deployments Documentation

Rolling Back and Deployment Triggers

Occasionally teams will wish to delay deploying a build that has been automatically created. For instance, you may wish to create a build for your production environment based on the state of your GitHub repository when a release candidate is generated. It is only after testing is completed that you will wish to deploy this new build to production.

By default, creating a new build will automatically trigger a new deployment. If you wish to delay deploying, you will need to edit the yaml within your deployment config. This is documented here. Remove the automatic: true line from your deployment config. This will disable the connection between building and deploying. Once your build has been tested, add that line back to your deployment config and trigger a deployment from the command-line with the following command:

oc deploy {the name of your deployment config} --latest=true

This will trigger a deployment of the existing build.

Note: The newly created deployment iteration will still display the old build version in the UI until the deployment is fully completed. So, if your deployment displays a prior version during deployment, do not be alarmed. The version will be updated once all pods are created.

Enabling Triggers

When rolling back from the GUI or command-line, deployment triggers are automatically disabled. This means that your next build will not trigger a new deployment until triggers are re-enabled. Read more about this here.

To re-enable the triggers use the following commands once logged into your project:

$oc deploy <name of deployment configuration> --enable-triggers

Last Updated: 
Thursday, September 13, 2018