AWS Cloud9
User Guide

Working with AWS CodePipeline in the AWS Cloud9 Integrated Development Environment (IDE)

You can use the AWS Cloud9 IDE to work with source code in repositories that are compatible with AWS CodePipeline.

AWS CodePipeline is a continuous delivery service you can use to model, visualize, and automate the steps required to release your software and ongoing changes you make to it. You can use AWS CodePipeline to quickly model and configure the different stages of a software release process. For more information, see the AWS CodePipeline User Guide.

Note

Completing these procedures might result in charges to your AWS account. These include possible charges for services such as Amazon EC2, AWS CodePipeline, Amazon S3, and AWS services supported by AWS CodePipeline. For more information, see Amazon EC2 Pricing, AWS CodePipeline Pricing, Amazon S3 Pricing, and Cloud Services Pricing.

AWS CodeStar provides additional features along with pipelines, such as project templates, dashboards, and teams. To use AWS CodeStar instead of AWS CodePipeline, skip the rest of this topic, and see Working with AWS CodeStar Projects instead.

Step 1: Create or Identify Your Source Code Repository

In this step, you create or identify a source code repository that is compatible with AWS CodePipeline.

Later in this topic, you upload your software's source code to that repository. AWS CodePipeline will build, test, and deploy the uploaded source code in that repository by using related pipelines that you also create.

Your source code repository must be one of the following repository types that AWS CodePipeline supports:

Step 2: Create an AWS Cloud9 Development Environment, Connect It to the Code Repository, and Upload Your Code

In this step, you create an AWS Cloud9 development environment in the AWS Cloud9 console. You then connect the environment to the repository that AWS CodePipeline will use. Finally, you use the AWS Cloud9 IDE for the environment to upload your source code to the repository.

To create the environment, follow the instructions in Creating an Environment, and then return to this topic. (If you already have an environment, you can use it. You don't need to create a new one.)

To connect the environment to the repository, and then upload your source code to the repository if it isn't already there, use one of the following sets of instructions. The set you choose depends on the type of repository that stores the source code.

Repository type Instructions

AWS CodeCommit

Follow these instructions in the AWS CodeCommit Sample:

Amazon S3

  • Install and configure the AWS CLI or aws-shell in the environment, as described in the AWS CLI and aws-shell Sample.

  • To upload your source code to the bucket, use the AWS CLI or the aws-shell in the environment to run the aws s3 cp command. (For the aws-shell, you can remove aws from the command.)

GitHub

Follow these instructions in the GitHub Sample:

After you connect the environment to the repository, whenever you push source code changes from the AWS Cloud9 IDE to the repository, AWS CodePipeline automatically sends those changes through related pipelines to be built, tested, and deployed. You create a related pipeline later in this topic.

Step 3: Prepare to Work with AWS CodePipeline

In this step, you attach a specific AWS managed policy to the IAM group you created or identified in Team Setup. This enables the group's users to begin creating and working with pipelines in AWS CodePipeline.

If you have used AWS CodePipeline before, skip ahead to Step 4: Create a Pipeline in AWS CodePipeline.

For this step, follow these instructions in Step 3: Use an IAM Managed Policy to Assign AWS CodePipeline Permissions to the IAM User in the AWS CodePipeline User Guide, and then return to this topic.

Step 4: Create a Pipeline in AWS CodePipeline

In this step, you create a pipeline in AWS CodePipeline that uses the repository you created or identified earlier in this topic.

For this step, follow the instructions in Create a Pipeline in AWS CodePipeline in the AWS CodePipeline User Guide.

After you create the pipeline, AWS CodePipeline sends the current version of the source code in the repository through the pipeline to be built, tested, and deployed. Then, whenever you push source code changes from the AWS Cloud9 IDE to the repository, AWS CodePipeline automatically sends those changes through the pipeline to be built, tested, and deployed.

To view the pipeline, follow the instructions in View Pipeline Details and History in AWS CodePipeline in the AWS CodePipeline User Guide.