Continuous Deployment

🚧

Currently, we support Continuous Deployment only for GitHub, GitLab, Bitbucket and Azure DevOps repositories.

Continuous Deployment in env0

env0 allows you to configure an environment to automatically re-deploy your environment with your updated terraform code on every push to a git branch. If a deployment is already in progress when a git push occurs, a deployment will be queued, and the environment will deploy again when the current deployment is finished.

📘

Connect Your Template To Your VCS

Before creating or configuring an environment to continuously deploy, make sure that you have a template integrated with GitHub, GitLab, Bitbucket or Azure DevOps.

New Environment

To create an environment, choose a specific Project, select the Project Templates tab, and then click Run Now on the template you want to use. On the Run Environment screen, pick the branch you would like to continuously deploy, and tick the Redeploy on every push to the git branch checkbox. Then, fill out the rest of the configuration for the deployment. When you're done, click Run.The environment will now deploy and will redeploy again on every push to the git branch

1438

New Environment Deploy Dialog

Existing Environment

Choose your Project, select the Project Environments tab, and then click on the environment you would like to configure for continuous deployment. Go to the Settings tab, tick the Redeploy on every push to the git branch checkbox.

You can choose to run by the following options:

  • Any change - your environment will redeploy on every push
  • Changes on Template Directory files - your environment will redeploy on every push which contains file changes in the Terraform folder used by the environment's template.
  • Changes by file filter pattern - your environment will redeploy on every push which contains changes in files matching the given pattern. See below how to configure glob pattern.
1610

Edit Existing Environment Settings

📘

Glob pattern

Glob patterns specify sets of filenames with wildcard characters. For example, *.txt or my_folder/**

It means you can configure pattern by git repository which re-deploy environment only if the push contains files that change by free pattern.

For example, you can configure pattern like src/project_1/**
In this case, we will re-deploy only if the push contains file which starts with src/project_1/...

We also support extglob patterns with that you can write pattern which ignores files or use a list of folders.
Note that for extglob, when using OR/AND statements, make sure to wrap each option with parentheses, for example: +((/first/path/)|(/second/path/))

Deployment Comment

When an environment is triggered due to CD - a comment would be automatically added, with a link to the head commit upon the time of trigger.

Skipping deployments

You can skip CD triggered by the push events by including a command in your commit message.

CDs that would otherwise be triggered using on: push won't be triggered if you add any of the following strings to the commit message in a push

[skip env0]  
[env0 skip]