Exam DOP-C02 All QuestionsBrowse all questions from this exam
Question 223

A company uses an AWS CodeCommit repository to store its source code and corresponding unit tests. The company has configured an AWS CodePipeline pipeline that includes an AWS CodeBuild project that runs when code is merged to the main branch of the repository.

The company wants the CodeBuild project to run the unit tests. If the unit tests pass, the CodeBuild project must tag the most recent commit.

How should the company configure the CodeBuild project to meet these requirements?

    Correct Answer: A

    To meet the requirements, the CodeBuild project needs to follow these steps: use native Git to clone the CodeCommit repository, run the unit tests, and create a tag if the unit tests pass. Using native Git to clone the repository ensures that all standard Git operations, including tagging and pushing changes, are supported seamlessly. By configuring the project to use native Git for creating and pushing the Git tag after successful unit tests, the company can ensure that the latest commit is tagged appropriately.

Discussion
tgv

---> A

syh_raphaOption: A

A https://docs.aws.amazon.com/codecommit/latest/userguide/getting-started.html#getting-started-create-commit

trungtdOption: A

Using Native Git: By configuring CodeBuild to use native Git, you ensure the repository is cloned in a way that supports all Git operations, including tagging and pushing changes. Running Unit Tests: CodeBuild can be set up to run the unit tests using the build specification file (buildspec.yml), ensuring that the tests are executed before any further actions are taken. Creating and Pushing Tags: post_build: commands: - echo Unit tests passed, tagging commit... - git tag -a v1.0.0 -m "Tagging commit after successful unit tests" - git push origin v1.0.0

KaranNishadOption: A

A is the Answer.

ihustle

A is the Answer.