What is a deployment?

This page provides an overview of deployments within Code Pipes, explaining their purpose and how they relate to application and environment entities.

Approx Reading Time: 5 minutes

What is a Deployment?

A deployment in Code Pipes refers to the process of deploying an application into an environment using a deployment template. This entity represents the specific deployment configuration for your application.

Once you have containerized your application, the next step is to create a Code Pipes deployment entity. This entity not only references your containerized application but also includes the following:

  • The deployment template that you want to use, along with its input variables. A deployment template exposes the necessary configuration values for deploying both the application and the environment to a specific cloud platform (such as GCP or AWS).

  • Environment-specific variables that the application requires during the deployment process in a particular environment.

Hierarchy Background - Deployment as a Child Entity

In Code Pipes, there are several entities that play a role in the deployment process:

  • Application: Represents the application you want to deploy.

  • Environment: Describes the cloud infrastructure in which you deploy your application.

Within the Code Pipes hierarchy, a deployment serves as a child entity of both an application and an environment, forming the following structure:

        Organization
            |
          Project
         /       \
  Environment  Application
                |
            Deployment

Explanation:

  • An organization contains one or more projects.
  • Each project can have multiple environments and applications.
  • A deployment is associated with a specific application and environment, serving as a child entity within the hierarchy.

Understanding this hierarchy is essential when creating deployments for your applications.

How to Create a Deployment

To create a deployment, follow these steps:

  1. Containerize your application and store it in a repository, such as gcr.io.

  2. Choose the appropriate deployment template for your application, considering the target cloud platform.

  3. Create an input file that contains the required inputs for your chosen deployment template.

  4. Provide values for environment variables that your deployment requires when executing the deployment pipeline—a deployment pipeline refers to the job responsible for deploying your application.

  5. Review the output of your deployment job, which may include key-value pairs representing various outputs, such as the Service URL of the deployed application.

Pick Your Deployment Template

We offer a range of predefined production-ready templates to help you get started with your deployments. These templates are open-source, allowing anyone to contribute and improve them.

You can find the deployment templates in our GitHub repository: Codepipes modules

Feel free to explore the repository and choose the deployment template that best suits your needs.

Provide Values for Environment Variables

As an application developer, you need to communicate the required environment variables and their retrieval methods to the application deployer.

Regarding variables obtained from the deployed environment:

Some environment variables are obtained from the parent entities, such as the environment. You can reference the Terraform output variables from the parent environment directly within the deployment's environment variables. This substitution occurs during the deployment job.

The syntax for referencing a Terraform output variable is ${terraform.variable_name_here.value}.

For example, if your deployment job requires the Kubernetes cluster name, which is available as a Terraform output variable from the Code Pipes environment, you can map it

Create a deployment

deployment-create

Update a deployment

deployment-update

Remove a deployment

deployment-remove