Skip to content

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

@hsiddhu2

Description

@hsiddhu2

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CodeBuild-localTag to track issues and PRs for CodeBuild local Docker image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jonnysooter@hsiddhu2

        Issue actions

          Looking for guidance for Local CodeBuild and using CodeBuild Environement Variables. · Issue #670 · aws/aws-codebuild-docker-images