Skip to content

TimothyJones/codepipeline-git-metadata-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodePipeline / CodeBuild / CodeCommit git metadata example

License: MIT

This project illustrates how to get git metadata into CodePipeline by cloning the repository and winding it back to the right commit. It is the companion code to this blog post, which explains the strategy in detail.

You can deploy it with a command like this:

aws cloudformation deploy --template-file cfn-pipeline.yaml \
    --stack-name=<YOUR_STACK_NAME>                          \
    --parameter-overrides                                   \
      RepositoryName=<YOUR_REPO_NAME>                       \
      RepositoryCloneUrl=<YOUR_REPO_CLONE_URL>              \
      RepositoryBranch=<OPTIONAL_YOUR_REPO_BRANCH>          \
      --capabilities CAPABILITY_IAM

Make sure to replace the bracketed values before deployment.

Full instructions

To see this in action, follow the following steps:

  1. Clone this repository.
git clone https://github.com/TimothyJones/codepipeline-git-metadata-example.git
  1. Create an AWS CodeCommit repository, note down the repository name and the clone URL.

  2. Add your new CodeCommit repo as a remote, and push:

git remote add aws <YOUR CLONE URL>
git push -u aws master

3b) If the above push fails, you will probably need to configure the AWS credential helper

  1. Deploy the pipeline:
aws cloudformation deploy --template-file cfn-pipeline.yaml \
    --stack-name=<ANY_NEW_STACK_NAME>                       \
    --parameter-overrides                                   \
      RepositoryName=<YOUR_REPO_NAME>                       \
      RepositoryCloneUrl=<YOUR_REPO_CLONE_URL>              \
      --capabilities CAPABILITY_IAM

About

Example showing how to get git metadata into an AWS CodeBuild build controlled by CodePipeline

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages