Skip to main content

Bitbucket Codeship integration tools.

Project description

https://img.shields.io/codeship/7ce18320-21cb-0134-bdd9-5a97be3a7e25/default.svg https://coveralls.io/repos/bitbucket/hellwig/bbcs-tools/badge.svg?branch=default https://img.shields.io/pypi/v/BBCS-Tools.svg https://img.shields.io/badge/Donate-PayPal-blue.svg https://img.shields.io/badge/Donate-Patreon-orange.svg

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.

Source Distribution

BBCS-Tools-1.0.2.1.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file BBCS-Tools-1.0.2.1.tar.gz.

File metadata

File hashes

Hashes for BBCS-Tools-1.0.2.1.tar.gz
Algorithm Hash digest
SHA256 64340acb1f750d118ce13553286b68bbc980ebc4f3e1ee282bff2da9848a61d3
MD5 bc2804cd42fdd89e6ec492ec0aa7c118
BLAKE2b-256 7c861bfce365b54c75f1e879530f5538e69c11b3dbac243c7f735480ef4372c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page