Skip to content
Paul Duvall edited this page Oct 25, 2019 · 17 revisions

1.4 Use the CodePipeline console

Review and ensure that you have setup your development environment before going through the steps below. Use the S3 bucket you created when setting up your development environment.

Clone the CodeCommit Repository

  1. If you haven't done so already, create a CodeCommit repo
  2. Clone the CodeCommit repo.
cd ~/environment/ccoa
git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/codecommit-demo
  1. Change the directory to your local CodeCommit repo:
cd ~/environment/ccoa/codecommit-demo
touch README.md
  1. Open the README.md file and paste the template configuration below and save.
# 1.4 README
  1. Add and commit files to your CodeCommit repo
git add .
git commit -am "initial commit of lesson1 files"
git push

Create a deployment pipeline using AWS CodePipeline

  1. Go to the CodePipeline console
  2. Click Create pipeline
  3. Enter a Pipeline name
  4. Keep the Allow AWS CodePipeline to create a service role so it can be used with this new pipeline checkbox selected
  5. Click Next
  6. Choose CodeCommit as the Source provider
  7. Choose codecommit-demo as the Repository name (based on Create AWS CodeCommit repository )
  8. Choose master as the Branch name
  9. Under Change detection options, leave Amazon CloudWatch Events (recommended) selected
  10. Click Next
  11. Click Skip build stage
  12. Choose Amazon S3
  13. Enter a BucketName based on the S3 bucket you created previously in this lesson (e.g. ccoa-ACCOUNTID)
  14. Choose an ObjectKey (e.g. my-deployment.zip)

CodePipeline Console

Modify the Pipeline

  1. Select the pipeline you just created
  2. Click the Edit button to edit the pipeline
  3. Click the Edit stage button to view how to edit a stage
  4. Click the Add stage button
  5. Click the Add action button
  6. Edit an existing action by clicking on the Pencil icon on the action
  7. Click the Disable transition button
  8. Click the Enable transition button
  9. Click on a Revision link
  10. Click the View current revisions button
  11. Click the View history button
  12. Click the Release change button
  13. Release Change

Transitions

To disable a transition, follow the instructions below.

aws codepipeline disable-stage-transition --pipeline-name MyFirstPipeline --stage-name Staging --transition-type Inbound --reason "My Reason"

To enable a transition, follow the instructions below.

aws codepipeline enable-stage-transition --pipeline-name MyFirstPipeline --stage-name Staging  --transition-type Inbound

Export a Pipeline

After manually creating a pipeline, you can export its contents in JSON format using the CLI. This is helpful when you want to run it from the CLI later or through AWS CloudFormation.

To pipe the contents of a specific pipeline to a JSON file, run the command below replacing YOUR_PIPELINE_NAME with your pipeline nameas found in your AWS CodePipeline Console.

aws codepipeline get-pipeline --name YOUR_PIPELINE_NAME > my-pipeline.json

For more information, see get-pipeline.

Delete a Pipeline

To delete a pipeline, follow the instructions below.

From the AWS CodePipeline console, select the pipeline you previously created:

  • Select Edit
  • Select Delete
  • Type in the name of the pipeline to confirm deletion and select Delete

Additional Resources

Cleanup

Go to Cleanup to remove any resources you created in this sublesson.

Clone this wiki locally