Using the AWS CodeDeploy task

このページの内容

With the AWS CodeDeploy task for Bamboo you can deploy applications to EC2 instances automatically, reliably, and rapidly. Additionally, AWS CodeDeploy keeps track of the whole deployment process.

このページの内容:

概要

The AWS CodeDeploy task compresses the specified directory with an AppSpec file into a .zip file, uploads the file to Amazon S3, and starts the deployment according to the configuration provided in the CodeDeploy application.

はじめる前に

There are several requirements that must be met before you can start using the AWS CodeDeploy task. In short, you must configure the following in your AWS Management Console:

  • an EC2 instance with a tagged deployment group
  • a CodeDeploy application
  • an IAM user

  • an S3 bucket

For more guidelines about your AWS configuration, see AWS CodeDeploy configuration for Bamboo.

The content that you want to be zipped and deployed requires a specific structure. For more information, see Preparing files for deployment.

Adding an AWS CodeDeploy task to a Bamboo plan

To use the CodeDeploy task:

  1. Go to the plan configuration.
  2. Click Add task.
  3. Select AWS CodeDeploy.
  4. Provide the following details:

     

    フィールド 説明
    Task description A short description of the task.
    このタスクを無効化 Select the check box to skip this task in the build.
    AWS credentials

    You can select existing AWS credentials from the list or add new AWS credentials. The newly created AWS credentials are added to the shared credentials list in Bamboo.  

    To make existing AWS credentials available for selection within the AWS CodeDeploy task in Bamboo, add them to Shared credentials.

    リージョン

    A region in which the application is deployed.

    Deployable content directory

    Location of the directory that contains the deployable content and an AppSpec file. By default, it is the root build directory. The content of the directory is compressed into a .zip file and sent to Amazon S3 bucket for deployment. For more information, see Preparing files for deployment.

    Amazon S3 bucket The name of an S3 bucket from which the deployable content (your app and the AppSpec file) is deployed. Start typing to open a selection list of the existing S3 buckets that are available for the AWS credentials provided in the task configuration. For more information, see Amazon S3 bucket.
    Application name The name of the CodeDeploy application that you created in the AWS management console. For more information, see AWS CodeDeploy application.
    Deployment group Start typing to open a list of deployment groups available for the Application name specified in the previous step.

AWS CodeDeploy configuration for Bamboo

The infrastructure setup is described in detail by AWS. For more information, see Getting Started with AWS CodeDeploy.

Atlassian provides guidelines for the following:

IAM user

We recommend creating a dedicated CodeDeploy IAM user or group.

The following policy gives full permissions to Amazon S3 buckets, CodeDeploy application and deployment group:

 

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "codedeploy:*",
                "s3:*"
            ],
            "Resource": "*"
        }
    ]
}

For more examples of policies, see Bucket Policy Examples.

AWS CodeDeploy application

Each CodeDeploy application holds information about the deployment configuration.

For more information, see Create an Application with AWS CodeDeploy.

Amazon S3 bucket

An Amazon S3 bucket must exist. We recommend creating a dedicated CodeDeploy S3 bucket that is located in the same region as the instances to which you want to deploy the application.

For more information about how to grant access to S3 buckets, see IAM user.

 

 

 

 

 

 

 

To make existing AWS credentials available for selection within the AWS CodeDeploy task in Bamboo, add them to Shared credentials.

 

 

 

Preparing files for deployment

The deployable content that is compressed and sent to an Amazon S3 bucket is called a revision and it consists of the application and an AppSpec (Application Specification) file.

Examples of revisions

 

最終更新日 2017 年 9 月 11 日

この翻訳に満足しましたか?

はい
いいえ
この記事についてのフィードバックを送信する

お探しの情報が見つかりませんか?

コミュニティへの質問

Powered by Confluence and Scroll Viewport.