Step 3: Upload a sample application to your GitHub repository - Amazon CodeDeploy
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Step 3: Upload a sample application to your GitHub repository

In this step, you will copy a sample revision from a public Amazon S3 bucket to your GitHub repository. (For simplicity, the sample revisions provided for this tutorial are single web pages.)

Note

If you use one of your revisions instead of our sample revision, your revision must:

If your revision meets these requirements, skip ahead to Step 5: Create an application and deployment group.

If you're deploying to an Ubuntu Server instance, you'll need to upload to your GitHub repository a revision compatible with an Ubuntu Server instance and CodeDeploy. For more information, see Plan a revision for CodeDeploy and Add an application specification file to a revision for CodeDeploy.

Push a sample revision from a local Linux, OS X, or Unix machine

With your terminal still open in, for example, the /tmp/CodeDeployGitHubDemo location, run the following commands one at a time:

Note

If you plan to deploy to a Windows Server instance, substitute SampleApp_Windows.zip for SampleApp_Linux.zip in the commands.

(Amazon S3 copy command)
unzip SampleApp_Linux.zip
rm SampleApp_Linux.zip

git add .
git commit -m "Added sample app"
git push

Where (Amazon S3 copy command) is one of the following:

  • aws s3 cp s3://aws-codedeploy-cn-north-1/samples/latest/SampleApp_Linux.zip . --region cn-north-1 for the China (Beijing) Region

  • aws s3 cp s3://aws-codedeploy-cn-northwest-1/samples/latest/SampleApp_Linux.zip . --region cn-northwest-1 for the China (Ningxia) Region

Push a sample revision from a local Windows machine

With your command prompt still open in, for example, the c:\temp\CodeDeployGitHubDemo location , run the following commands one at a time:

Note

If you plan to deploy to an Amazon Linux or RHEL instance, substitute SampleApp_Linux.zip for SampleApp_Windows.zip in the commands.

(Amazon S3 copy command)

Unzip the contents of the the ZIP file directly into the local directory (for example c:\temp\CodeDeployGitHubDemo), not into a new subdirectory.

git add .
git commit -m "Added sample app"
git push

Where (Amazon S3 copy command) is one of the following:

  • aws s3 cp s3://aws-codedeploy-cn-north-1/samples/latest/SampleApp_Windows.zip . --region cn-north-1 for the China (Beijing) Region

  • aws s3 cp s3://aws-codedeploy-cn-northwest-1/samples/latest/SampleApp_Windows.zip . --region cn-northwest-1 for the China (Ningxia) Region

To push your own revision to an Ubuntu Server instance, copy your revision into your local repo, and then call the following:

git add . git commit -m "Added Ubuntu app" git push