Automate Deployments

Overview

In this section, you will learn how to automate deployments directly from your CI pipeline.

On Humanitec you can automate your environments, by defining automation rules that can be run based on triggers. For example, you can configure Humanitec to deploy your environment every time a new container image is built on dev branch.

Automate your environment

  1. In your app view, find the environment that you would like to automate.
  2. Click on the arrow next to this environment and select Automation. click-automation
  3. In the overlay, click to add a rule.
  4. Define the rule:
    • The rule can apply to All images, Selected images, All images except.
    • It can update when the lastest tag or HEAD of branch are built.
    • The tag or HEAD of branch can be specified in the field That matches, using regular expression. If it is empty, it will match any tag or HEAD of branch.
  5. You can add more rules if needed or click Done add-automation-rules

Once a new image image is built, based on your automatic deployment rules, Humanitec will initiate deployment to your environment.

At any point in time you can deploy manually by clicking Deploy button in the top right corner in your application view.

All automated deployments are tracked in deployment version history. You can see, in real time, when an automatic deployment is running in your environments.

auto-deploy-history

Deactivate automation

If you would like to keep your automation rules but stop automatic deployments, you can deactivate your rules.

  1. In your app view, find the environment that you want to edit.
  2. Click on the arrow next to this environment and select Automation.
  3. If the toggle next to your rule is blue - it is Active. Click on it to deactivate the rule.
  4. Click Done

Delete automation

  1. In your app view, find the environment that you want to edit.
  2. Click on the arrow next to this environment and select Automation.
  3. Click Delete next to the rule that you want to remove.
  4. Click Done.