Quick and dirty project for using AWS codebuild/pipeline for CI / build of a custom AMI. Uses a custom docker build image located here:
- This project
- packer template for simple PHP app
- config bootstrap script (optionally you can use ansible or another config mgmt tool)
- buildspec.yaml - AWS codebuild
- This container for the build container aws-codebuild-alpine-container
- This json skel for the codebuild project details the config
- This json skel for the aws pipeline details the config
Note: You can reuse the json referenced above and in this repo as a template, but you will have to adjust for your aws acct and environment. Use in conjunciton with the following aws cli commands:
Example of get and update via AWS CLI:
aws codebuild update-project --name name_of_your_codebuildprj --profile yourprofile
- retrieves codebuild proj as json which you can edit and feed back into the following command.aws codebuild update-project --environment your_jsonsnippet_edited --profile yourprofile
- Here we are changing the 'environment'. See example in this Makefile which automates this during docker image creation
Example of get and update via AWS CLI:
aws codepipeline get-pipeline --name name_of_your_pipeline --profile yourprofile
- retrieves pipeline as json which you can edit and feed back into the following commandaws codepipeline update-pipeline --pipeline your_json_edited --profile yourprofile
More examples here in AWS CLI documentation:
This is mainly a re-creation of my jenkins-pipeline-immut project using aws codebuild/pipeline. Learning tool POC mostly. The AWS codebuild/pipeline was created manually in the AWS console. Although currently without IaC provisioning that the jenkins repo contains (using terrafrom) which is a TODO for this project/repo.
- Cloudformation or Terraform to:
- create the codebuild, pipeline itself
- create infra envs for deployment
- add deployment (CD) steps for an application
- automate, automate, automate....
Hashicorp AWS