Claus Sandgren
Claus Sandgren

Reputation: 69

building code with aws codebuild. Source version syntax

I'm trying to build my code with AWS codebuild on a specific branch. But it always fails the because of the yml file not being there (because of git branching) or i get a "Git Clone Failed: invalid reference:"

Can anyone tell me what the correct syntax for source version is when you're working with git branches?

Upvotes: 0

Views: 2056

Answers (2)

hynespm
hynespm

Reputation: 671

So, the source parameter of a Codebuild project can be connected to Github, S3, Codecommit and I believe a Bitbucket repo. It is here that you specify the branch.

The buildspec.yaml file then runs particular commands to build your code. For example, if it was Java code that uses maven. You could have a statement like this

mvn clean install

This would run tests and build your code.

I think if you wish to get source code from other git repos, not mentioned above. You should just look up correct git checkout commands and also have authentication various as environment variables of your Codebuild project.

Upvotes: 0

Clare Liguori
Clare Liguori

Reputation: 1650

The CodeBuild "source version" parameter takes anything that "git checkout" does: branch, commit ID, etc. For example, use "master" for building the master branch.

Upvotes: 2

Related Questions