Skip to main content

Bitbucket Codeship integration tools.

Project description

https://coveralls.io/repos/bitbucket/hellwig/bbcs-tools/badge.svg?branch=default

BBCS Tools

Python3 / Bitbucket / Codeship / Mercurial / Coveralls / PyPI Integration.

What is it?

  • Tools for integrating several services together.

What problem does it solve?

  • Uploading build status to the hg commit in Bitbucket
  • Uploading coverage status to coveralls
  • Uploading packages to pypi

How do I install it?

$ pip install bbcs-tools

How do I use it?

This package is meant to be used within codeship itself, here is a guide how I configured it:

Environment

Make sure you have the following keys defined:

  • BB_USERNAME # This is your bitbucket username, used for updating the build status update.
  • BB_PASSWORD # This is your bitbucket password, again for the build status update.
  • COVERALLS_REPO_TOKEN # This is the token as generated by coveralls.
  • PP_USERNAME # The username you use for uploading pypi packages.
  • PP_PASSWORD # And the corresponding password.
  • RUN_SOURCE # This tells coverage only to cover the source in this directory.
  • RUN_MODULE # This is the module that contains/runs your tests, for example ‘test.py’

Test

Test comes in two parts, ‘Setup Commands’ and ‘Configure Test Pipelines’, you want to chose ‘I want to create my own custom commands’.

Setup Commands

This is what I have in there:

################################################################################
# Switch to python 3
virtualenv -p $(which python3) "${HOME}/cache/python3_env"
source "${HOME}/cache/python3_env/bin/activate"
################################################################################
# First install bitbucket/codeship integration tools
pip install bbcs-tools
# Notify bitbucket that build has started
bbcs_build_started
################################################################################
#  Now install application specific requirements
pip install -r requirements.txt
################################################################################
Configure Test Pipelines

And here is what is in mine:

################################################################################
# Run the unit test with coverage, if there is a fail we notify bitbucket
coverage run --source=$RUN_SOURCE $RUN_MODULE || bbcs_build_failure
# Notify bitbucket the build has run successfully.
bbcs_build_stopped
################################################################################
# Upload coverage data to coveralls
bbcs_upload_coverage_to_coveralls
################################################################################

Deployment

Again choose custom script, I have mine configure to do a build and upload on every commit on the default branch. Here is what is in my deploy script:

################################################################################
# Build an sdist package and upload it to pypi.
bbcs_upload_package_to_pypi
################################################################################

What license is this?

Two-clause BSD

How can I get support?

Please use the repo’s bug tracker to leave behind any questions, feedback, suggestions and comments. I will handle them depending on my time and what looks interesting. If you require guaranteed support please contact me via e-mail so we can discuss appropriate compensation.

Signing Off

Is my work helpful or valuable to you? You can repay me by donating via:

https://paypal.me/MartinHellwig

Donate via PayPal.Me

-or-

https://www.patreon.com/hellwig

Donate via Patreon

Thank you!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
BBCS-Tools-1.0.2.1.tar.gz (5.2 kB) Copy SHA256 hash SHA256 Source None Sep 21, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page