Deployment overview
Introduction
Once a software application has been developed and tested, it needs to be deployed and made available for its intended audience. With CircleCI, you can deploy to virtually any target. CircleCI can also be configured to integrate with other services for:
-
QA and testing
-
Feature management
-
Deployment strategies such as blue-green or canary deployment
Quickly customize your configuration to match your requirements, whether you need a fully automated process or one that requires manual approval.
Deploy to Kubernetes? Refer to our Releases overview page to start managing your releases in the CircleCI web app. CircleCI releases is in open preview. |
The basics of deployment
Here are the core concepts you need to get a deployment set up:
-
Deployment job: To deploy your application, add a job to your
.circleci/config.yml
file and configure the job to run the steps you require.Add a release log step to your deployment job to view a log of releases in the CircleCI web app. See the Release markers guide to learn more. -
Deployment parameters: You may need to add environment variables and SSH keys to fulfill your deployment steps. Environment variables can be:
-
Defined within your configuration
-
Added to the project itself through the CircleCI web app:
-
Add project-level environment variables
-
Add project-level SSH keys
-
-
-
Manual approval: If your deployment strategy requires a manual approval step, you can include a hold/approve job in your workflow. A manual approval button will then be available from the workflows map in the CircleCI web app.
If you need to restrict connections, consider enabling IP ranges for your deployment job.
Using orbs to simplify deployment
Orbs are packages of reusable configuration. For simpler deployment pipelines, you can use orbs to achieve the results you need with minimal configuration. Orbs are available for many common deployment targets. Check out the full range of available orbs in the orbs registry.
For example, the AWS CodeDeploy orb has a pre-configured deploy
job that you can include in your configuration with the single line aws-code-deploy/deploy
once the orb has been invoked by adding the orbs stanza:
version: 2.1
orbs:
aws-code-deploy: circleci/aws-code-deploy@x.y
workflows:
deploy_application:
jobs:
- aws-code-deploy/deploy:
application-name: myApplication
bundle-bucket: myApplicationS3Bucket
bundle-key: myS3BucketKey
deployment-group: myDeploymentGroup
service-role-arn: myDeploymentGroupRoleARN
Under the hood, this orb creates, bundles, and deploys your application using your specified parameters set under the aws-code-deploy/deploy
job declaration.
Using images to simplify deployment
CircleCI provides maintained Docker images (convenience images) that contain the tools required for common deployment scenarios. Convenience images provide fast spin-up times, reliability, and stability. Visit the CircleCI Developer Hub to learn more about each of the deploy convenience images:
Next steps
Use the following how-to guides to deal with common use cases:
-
For examples of deploying to Kubernetes, see the guides in the Continuous deployment config examples repo.
Go to the orbs registry to simplify your configuration by using an orb for your deployment target. If the orb you need has not been created yet, consider authoring one!