You can use AWS CodeBuild to build this project and push the contianer image to Docker hub.
You can use the AWS console or the AWS CLI with the scripts in the codebuild
folder.
Use the AWS CodeBuild console to create a CodeBuild project as follows
- Give the project a name
- Select the GitHub project to build
- Choose build image: 'aws/codebuild/docker:1.12.1'
- Opt to use the 'buildspec.yml' file
- Choose 'No Artifacts'
- Choose (or create) the AWS Service Account to use
Use the AWS CodeBuild console to start the build
- Choose 'Start Build'
- If necessary, enter the git branch or commit ID
- Add or update the following environment variables
CONTAINER_VERSION
DOCKER_REPO
DOCKER_HUB_USERNAME
DOCKER_HUB_PASSWORD
- Start the Build
- Check the build logs afterwards
This requires you have AWS CLI installed, a CodeBuild Service Account, and have linked CodeBuild to GitHub.
- Update the GitHub URL and AWS Service Account in the
cloudbuild.json
file - Create the project, specifying your profile and the region if not your default
aws codebuild create-project --profile default --region=us-east-1 --cli-input-json file://codebuild-project.json
- Set the following environment variables or customise
build.env
andsource build.env
export PROJECT_NAME="kube-cert-manager"
export PROJECT_REGION="us-east-1"
export SOURCE_VERSION=""
export CONTAINER_VERSION="0.5.0"
export DOCKER_REPO=<your Docker Hub repo name>
export DOCKER_HUB_USERNAME=<your username>
export DOCKER_HUB_PASSWORD=<your password>
- Start the build with
start-codebuild.sh
- View the build log with
get-codebuild-log.sh