Skip to content
New issue

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

Looking for guidance for Local CodeBuild and using CodeBuild Environement Variables. #670

Open
hsiddhu2 opened this issue Aug 23, 2023 · 0 comments

Comments

@hsiddhu2
Copy link

I want to run the below command in my buildspec.yml to identify the list of files that have changed between a specific commit and its parent commit.

CHANGED_OBJECTS=$(git diff-tree --no-commit-id --name-only -r $CODEBUILD_WEBHOOK_HEAD_REF)

But when I'm trying to build the project using Local CodeBuild using the command below -

./codebuild_build.sh -i aws-codebuild-docker-images/ubuntu/standard/5.0:latest -a artifacts -s /project-root-director -e .env -c

I'm getting this error -

' [Container] 2023/08/23 21:54:17 Command did not exit successfully CHANGED_OBJECTS=$(git diff-tree --no-commit-id --name-only -r $CODEBUILD_WEBHOOK_HEAD_REF) exit status 129
agent_1 | [Container] 2023/08/23 21:54:17 Phase complete: BUILD State: FAILED
agent_1 | [Container] 2023/08/23 21:54:17 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: CHANGED_OBJECTS=$(git diff-tree --no-commit-id --name-only -r $CODEBUILD_WEBHOOK_HEAD_REF). Reason: exit status 129`

Can someone please guide me and explain how to do this in a local code build environment? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant