1

I am building CI/CD process using CodeBuild and I'd like to have tests run when pull requet is created (I'm using Bitbucket). As I can see I'm able to set up a trigger when pull requests from branch feature/{xxx} is created but also I have to make CodeBuild to checkout to the branch feature/{xxx}. There is input for Source version but I can't put there anything parameterized. How to do it the right way? Or how to do it at all?

1 Answer 1

1

If your buildspec is static between branches, then you can do a checkout in the buildspec to switch to files from the commit that initiated the webhook.

Use commands like, e.g.

git checkout $CODEBUILD_WEBHOOK_HEAD_REF

Tip: Use printenv in the buildspec to check for available CodeBuild variables and what suits to get the required commit.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.