InCommon Advance CAMP (ACAMP) 2022—Build Your Own Docker Official Images
Copy this repository to a supported hosting service (e.g., GitHub) and deploy the CI/CD pipeline using CloudFormation.
git clone [email protected]/example/devops-library-demo
cd devops-library-demo
ECR_PUBLIC_ALIAS=$(
aws ecr-public describe-registries \
--query 'registries[0].aliases[0].name' \
--output text
)
aws cloudformation create-stack --stack-name devops-library-demo \
--template-body file://.cloudformation/pipeline.yaml \
--capabilities CAPABILITY_IAM \
--parameters \
ParameterKey=GitRepoId,ParameterValue=example/devops-library-demo \
ParameterKey=RegistryServer,ParameterValue=public.ecr.aws \
ParameterKey=RegistryOwner,ParameterValue=${ECR_PUBLIC_ALIAS} \
;
In the AWS console, navigate to the AWS Developer Tools settings. Select the connection with the same name as the CloudFormation stack, e.g., devops-library-demo, and click Update pending connection. Choose an existing app or install a new one if necessary. When installing a new app, grant the AWS Connector for GitHub access to at least that specific repository in your organization. For further instructions on how to complete the connection, refer to Create a connection to GitHub and Update a pending connection in the AWS Developer Tools console user guide.
After making the connection to GitHub, navigate to the AWS CloudFormation console. Select the CloudFormation stack, e.g., devops-library-demo. On the stack outputs tab, click the value of PipelineUrl to open the CI/CD pipeline. On the pipeline detail page, click Release change, which builds and publishes Docker images from the configured GitHub repository (this repository) for the first time.
Please follow the Python Style Guide (PEP8), Dockerfile best practices, AWS CloudFormation best practices, and the Home Assistant YAML style guide as appropriate.
In CloudFormation templates, please follow the recommended template section ordering.
In shell scripts, indent using single tabs instead of spaces.
Please follow Angular Commit Message Conventions. The following scopes are currently in use:
- pipeline: the CloudFormation stack template defining the CI/CD pipeline
- buildspec: the CodeBuild specification
- license: software licensing information, specifically LICENSE.md
- readme: this file