Enabling continuous deployment
Cloud 66 offers several ways to achieve continuous deployment for your applications. These methods all use triggers (such as commits to git repositories) to initiate the deployment process for your apps. This doc explores and compares each of the options.
|Cloud 66 GitHub application||Very quick & easy, no manual set up required||Limited to GitHub, less configurable and extensible, no access to deployment profiles|
|Redeployment hooks||Can be used on non-Github repos, can use deployment profiles, more extensible (for example can be used with a continuous integration platform)||Requires some manual set up, lacks some more advanced deployment features|
|Cloud 66 Toolbelt (or API)||The most customisable option with full access to all deployment features. Very flexible and extensible.||Requires some engineering work and careful configuration|
🚨 If you had already enabled continuous integration via the Toolbelt and added redeployment hooks to your GitHub repo (before January 2022), you will now be sending two deployment signals to Cloud 66. Please remove any redeployment hooks from GitHub if you are using automated continuous deployment (see below).
Enabling automated continuous deployment
This method is only available if you have connected your Cloud 66 account to GitHub by installing the Cloud 66 GitHub account. If you have not done this, please follow our guide.
you can enable (and disable) continuous deployment in the Cloud 66 Dashboard:
- Log into your Cloud 66 Dashboard and click on your app
- Click on ⚙️ Settings & Information in the Application panel on the right of the screen
- Scroll down to the Deployment panel
- Check the box next to Continuous Deployment
You can also enable (and disable) continuous deployment via the Cloud 66 Toolbelt:
To do this modify your application settings via the toolbelt and set continuous.deploy to true. For example:
$ cx settings set -s my_app_name continuous.deploy true
Your application will now be deployed every time you commit changes to the branch of your repo which the application is set to use.
⚠️ This is particularly useful for development versions of your application, but we advise caution when using this feature with your live application.
Continuous integration tests
When you enable continuous deployment (as above) your application will deploy as soon as we detect an update to its repository. However, if you have tests or other integration tasks that run on GitHub (or that GitHub is aware of), you can set your application to wait for these to pass before deploying.
To do so, check the box next to Wait for continuous integration tests to pass before deploying. (This option only appears once you have enabled continuous deployment - see above).
Continuous deployment via redeployment hooks
Redeployment hooks are unique (per application) webhooks that trigger a deployment process for their related application. They will work with any system or service that accepts webhooks and can also be invoked manually, or via shell scripts. They can call deployment profiles, and their payloads can contain information on the branch being deployed.
Read our guide to redeployment hooks for more information on setting them up.
Continuous deployment via the Cloud 66 Toolbelt
The Cloud 66 Toolbelt (cx) gives you full control over your applications, including settings not available via the Dashboard.
redeploy command can be used to trigger the deployment of any existing application.
The cx redeploy command
Enqueues redeployment of an existing application. If the app is already building, another build will be enqueued and performed immediately after the current one is finished.
$ cx redeploy --stack <application name> --listen [-y] [--git-ref <git_ref>] [--service <service>] [--deploy-strategy <strategy>] [--rollout-strategy <strategy>] [--canary-percentage <percentage>] [--deployment-profile <profile name>]
|--stack, -s <application name>||yes||—||Full or partial name of the application|
|-y||no||—||Answer yes to confirmations|
|--listen||no||—||Waits for deployment to complete, shows progress and log output when available|
|--git-ref <git_ref>||no||—||Redeploy the specific git reference (branch, tag or hash).|
|--service <service>||no||—||Will deploy the specified services from your application. Each service can have an optional colon-separated reference which is an image tag or git reference.|
|--deploy-strategy <strategy>||no||—||Set a strategy for this redeployment. Options are serial, parallel, rolling (Rails/Rack) or fast (Maestro)|
|--rollout-strategy <strategy>||no||none||Set a rollout strategy for this redeployment. Options are none, blue_green_immediate, blue_green_delayed, or canary|
|--canary-percentage <percentage>||no||—||Set the percentage of traffic to direct to a canary rollout|
|--deployment-profile <profile name>||no||—||Use an existing profile for this redeployment.|
$ cx redeploy -s "My Awesome App" -e production --deploy-strategy fast $ cx redeploy -s "My Awesome App" -e production -y --git-ref my_git_ref_value $ cx redeploy -s "My Awesome Containerized App" --service web:8c7f3d393162f88b8b9493f6babec574b03ca957 --service api:latest
You can find more info about Toolbelt commands in the full reference guide.
Via the Cloud 66 API
You can also use the
deployments method in the Cloud API to trigger deployments. Read the API guide for more info.