Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set up local testing for codebuild
#!/bin/bash
docker --version
if [[ $? != 0 ]]; then
brew cask install docker
fi
echo "Make sure you have $HOME/bin in your PATH"
mkdir -p ~/bin/
curl https://raw.githubusercontent.com/aws/aws-codebuild-docker-images/master/local_builds/codebuild_build.sh > ~/bin/codebuild_build.sh
chmod +x ~/bin/codebuild_build.sh
git clone https://github.com/aws/aws-codebuild-docker-images.git
cd aws-codebuild-docker-images/ubuntu/python/3.6.5
docker build -t aws/codebuild/python:3.6.5 .
echo "Resources:"
echo " Build Spec ref: https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html"
echo " Codebuild images repo: https://github.com/aws/aws-codebuild-docker-images"
echo ""
echo "Play in the docker container to test stuff:"
echo " $ docker run -it --entrypoint sh aws/codebuild/python:3.6.5 -c bash"
echo ""
echo "Test local builds by changing into the directory with your buildspec.yml and running:"
echo ""
echo " $ codebuild_build.sh -i aws/codebuild/python:3.6.5 -a ~/build_artifacts"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.