question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support AWS CodeBuild projects

See original GitHub issue

Hello, thanks for the great work at CodeCov. We use it in several projects, and have recently ported from CircleCI to AWS CodeBuild (for price and AWS CodePipeline integration).

We are currently using the codecov shell script and doing some shell magic to make it all work. It would be wonderful if CodeBuild was supported “automagically” like the other CI providers.

If it helps, here is what we’ve done so far, and it seems to mostly be working. Once we pull the plug on Circle completely, we’ll know if the uploads to master are working correctly.

VCS_PULL_REQUEST=$(echo $CODEBUILD_SOURCE_VERSION | grep pr | sed 's/pr\///g')

With that set, the git fallback seems to be handling the rest.

Here are the CodeBuild environment variables: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

1reaction
spockNinjacommented, Jun 20, 2019

I believe we now have several projects using this tool with no additional magic required.

Here is a simplified buildspec that is working for us.

version: 0.2
    
phases:
  pre_build:
    commands:
      - pip install -r requirements/test.txt
  build:
    commands:
      - pytest --cov=src/ tests
  post_build:
    commands:
      - codecov

cache:
  paths:
    - '/root/.cache/pip/**/*'

where we have codecov==2.0.15 pinned in the requirements/test.txt file.

1reaction
spockNinjacommented, Sep 27, 2018

@gitblit Yes, we ran into the issue of non-pr’s causing an issue. That’s why we just threw the || true bit on the end of that last command, to keep those builds from failing.

There have also been some improvements to this package since our initial trial, so we are able to use it instead of the codecov.sh script, still with similar env variables and parameters.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS::CodeBuild::Project - AWS CloudFormation
The AWS::CodeBuild::Project resource configures how AWS CodeBuild builds your source code. For example, it tells CodeBuild where to get the source code and ......
Read more >
Create a build project in AWS CodeBuild
You can use the AWS CodeBuild console, AWS CLI, or AWS SDKs to create a build project. Prerequisites. Before creating a build project,...
Read more >
Use AWS CodeBuild with Amazon Virtual Private Cloud
To use the AWS CLI to create a build project, see Create a build project (AWS CLI). If you are using the AWS...
Read more >
Public build projects in AWS CodeBuild
AWS CodeBuild allows you to make the build results, logs, and artifacts for your build projects available to the general public. This allows...
Read more >
Advanced setup - AWS CodeBuild
You can create a CodeBuild service role by using the CodeBuild or AWS CodePipeline consoles. For information, see: Create a build project (console)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found