aws / aws-codebuild-docker-images

Official AWS CodeBuild repository for managed Docker images http://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref.html
Other
1.12k stars 977 forks source link

Local build verbose output on macOS #446

Open dixonaws opened 3 years ago

dixonaws commented 3 years ago

I'm using the instructions here: https://docs.aws.amazon.com/codebuild/latest/userguide/use-codebuild-agent.html to test my local builds. However, the only debug messages that are show in the console after running ./codebuild_build.sh -i aws/codebuild/standard:4.0 -a build in my repository directory appear to be only [Container] messages, which are not particularly helpful. Here's a sample:

Build Command:

docker run -it -v /var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=aws/codebuild/standard:4.0" -e "ARTIFACTS=/Users/jpdixon/Developer/sites/www.aws-cloudops.com/build" -e "SOURCE=/Users/jpdixon/Developer/sites/www.aws-cloudops.com" -e "INITIATOR=jpdixon" amazon/aws-codebuild-local:latest

Removing agent-resources_build_1 ... done
Removing agent-resources_agent_1 ... done
Removing network agent-resources_default
Removing volume agent-resources_source_volume
Removing volume agent-resources_user_volume
Creating network "agent-resources_default" with the default driver
Creating volume "agent-resources_source_volume" with local driver
Creating volume "agent-resources_user_volume" with local driver
Creating agent-resources_agent_1 ... done
Creating agent-resources_build_1 ... done
Attaching to agent-resources_agent_1, agent-resources_build_1
agent_1  | [Container] 2021/04/05 16:42:38 Waiting for agent ping
agent_1  | [Container] 2021/04/05 16:42:41 Waiting for DOWNLOAD_SOURCE
agent-resources_agent_1 exited with code 0
Stopping agent-resources_build_1 ... done
Aborting on container exit...

When executing the commands in my buildspec.yaml, I know that the build fails in the install stage. This is also the case when I run the build using the AWS console and viewing the debug messages there. However, the only error message from the local build is agent-resources_agent_1 exited with code 0. The codebuild_build.sh command does not seem to have a verbose flag to show all debug output. Can a verbose output flag be added to the codebuild_build.sh script to see detailed debug messages?

berenddeboer commented 3 years ago

It seems it times out or aborts getting the source. Shouldn't you specify the -s or -m command?