We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Attempting to use the -b option to specify an override buildspec path results in "no such file or directory". This is even when the -m switch is used. When I changed https://github.com/aws/aws-codebuild-docker-images/blob/master/local_builds/codebuild_build.sh#L134 to docker_command+=" -e \"BUILDSPEC=$buildspec\"" it found the specified path.
-b
-m
docker_command+=" -e \"BUILDSPEC=$buildspec\""
To Reproduce Steps to reproduce the behavior:
buildspec-test.yml
--- version: 0.2 phases: build: commands: - echo "Hello World"
./codebuild_build.sh -m -b buildspec-test.yml \ -i public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0 \ -a ./build \ -s . \ -l public.ecr.aws/codebuild/local-builds
Build Command: docker run -it -v /var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0" -e "ARTIFACTS=/tmp/test/build" -e "SOURCE=/tmp/test/." -e "BUILDSPEC=/tmp/test/buildspec-test.yml" -e "LOCAL_AGENT_IMAGE_NAME=public.ecr.aws/codebuild/local-builds" -e "MOUNT_SOURCE_DIRECTORY=TRUE" -e "INITIATOR=user" public.ecr.aws/codebuild/local-builds 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] 2022/11/24 16:03:59 going inside waitForAgent agent_1 | [Container] 2022/11/24 16:03:59 Waiting for agent ping agent_1 | [Container] 2022/11/24 16:03:59 Waiting for DOWNLOAD_SOURCE agent_1 | [Container] 2022/11/24 16:03:59 Phase is DOWNLOAD_SOURCE agent_1 | [Container] 2022/11/24 16:03:59 finished waitForAgent agent_1 | [Container] 2022/11/24 16:03:59 inside CopySrc agent_1 | [Container] 2022/11/24 16:03:59 CODEBUILD_SRC_DIR=/codebuild/output/src579579692/src agent_1 | [Container] 2022/11/24 16:03:59 finished CopySrc agent_1 | [Container] 2022/11/24 16:03:59 Phase complete: DOWNLOAD_SOURCE State: FAILED agent_1 | [Container] 2022/11/24 16:03:59 Phase context status code: YAML_FILE_ERROR Message: stat /tmp/test/buildspec-test.yml: no such file or directory agent_1 | [Container] 2022/11/24 16:03:59 Runtime error (*clienterr.PhaseContextError: stat /tmp/test/buildspec-test.yml: no such file or directory) agent-resources_build_1 exited with code 11 Aborting on container exit...
Expected behavior
Build Command: docker run -it -v /var/run/docker.sock:/var/run/docker.sock -e "IMAGE_NAME=public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0" -e "ARTIFACTS=/tmp/test/build" -e "SOURCE=/tmp/test/." -e "BUILDSPEC=buildspec-test.yml" -e "LOCAL_AGENT_IMAGE_NAME=public.ecr.aws/codebuild/local-builds" -e "MOUNT_SOURCE_DIRECTORY=TRUE" -e "INITIATOR=user" public.ecr.aws/codebuild/local-builds 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] 2022/11/29 04:27:30 going inside waitForAgent agent_1 | [Container] 2022/11/29 04:27:30 Waiting for agent ping agent_1 | [Container] 2022/11/29 04:27:30 Waiting for DOWNLOAD_SOURCE agent_1 | [Container] 2022/11/29 04:27:31 Phase is DOWNLOAD_SOURCE agent_1 | [Container] 2022/11/29 04:27:31 finished waitForAgent agent_1 | [Container] 2022/11/29 04:27:31 inside CopySrc agent_1 | [Container] 2022/11/29 04:27:31 CODEBUILD_SRC_DIR=/codebuild/output/src366791390/src agent_1 | [Container] 2022/11/29 04:27:31 finished CopySrc agent_1 | [Container] 2022/11/29 04:27:31 YAML location is /codebuild/output/srcDownload/src/buildspec-alternative.yml agent_1 | [Container] 2022/11/29 04:27:31 Processing environment variables agent_1 | [Container] 2022/11/29 04:27:31 Moving to directory /codebuild/output/src366791390/src agent_1 | [Container] 2022/11/29 04:27:31 Registering with agent agent_1 | [Container] 2022/11/29 04:27:31 Phases found in YAML: 1 agent_1 | [Container] 2022/11/29 04:27:31 BUILD: 1 commands agent_1 | [Container] 2022/11/29 04:27:31 Phase complete: DOWNLOAD_SOURCE State: SUCCEEDED agent_1 | [Container] 2022/11/29 04:27:31 Phase context status code: Message: agent_1 | [Container] 2022/11/29 04:27:31 Entering execCommands agent_1 | [Container] 2022/11/29 04:27:31 Entering phase INSTALL agent_1 | [Container] 2022/11/29 04:27:31 Phase complete: INSTALL State: SUCCEEDED agent_1 | [Container] 2022/11/29 04:27:31 Phase context status code: Message: agent_1 | [Container] 2022/11/29 04:27:31 Entering phase PRE_BUILD agent_1 | [Container] 2022/11/29 04:27:31 Phase complete: PRE_BUILD State: SUCCEEDED agent_1 | [Container] 2022/11/29 04:27:31 Phase context status code: Message: agent_1 | [Container] 2022/11/29 04:27:31 Entering phase BUILD agent_1 | [Container] 2022/11/29 04:27:31 Running command echo "Hello World" agent_1 | Hello World agent_1 | agent_1 | [Container] 2022/11/29 04:27:31 Phase complete: BUILD State: SUCCEEDED agent_1 | [Container] 2022/11/29 04:27:31 Phase context status code: Message: agent_1 | [Container] 2022/11/29 04:27:31 Entering phase POST_BUILD agent_1 | [Container] 2022/11/29 04:27:31 Phase complete: POST_BUILD State: SUCCEEDED agent_1 | [Container] 2022/11/29 04:27:31 Phase context status code: Message: agent-resources_agent_1 exited with code 0 Stopping agent-resources_build_1 ... done Aborting on container exit...
Logs If applicable, add log output to help explain your problem.
Platform (please complete the following information):
Additional context Notice that the BUILDSPEC environmental variable is relative to the source (not the volume)
BUILDSPEC
The text was updated successfully, but these errors were encountered:
Fix buildspec override file location aws#585
56a4b2d
The buildspec override file location should be relative to CODEBUILD_SRC_DIR. Currently it's passing an absolute path based on the host.
No branches or pull requests
Describe the bug
Attempting to use the
-b
option to specify an override buildspec path results in "no such file or directory". This is even when the-m
switch is used. When I changed https://github.com/aws/aws-codebuild-docker-images/blob/master/local_builds/codebuild_build.sh#L134 todocker_command+=" -e \"BUILDSPEC=$buildspec\""
it found the specified path.To Reproduce
Steps to reproduce the behavior:
buildspec-test.yml
Expected behavior
Logs
If applicable, add log output to help explain your problem.
Platform (please complete the following information):
Additional context
Notice that the
BUILDSPEC
environmental variable is relative to the source (not the volume)The text was updated successfully, but these errors were encountered: