Bitbucket Codeship integration tools.
Project description
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
-or-
https://www.patreon.com/hellwig
Thank you!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file BBCS-Tools-1.0.2.1.tar.gz
.
File metadata
- Download URL: BBCS-Tools-1.0.2.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64340acb1f750d118ce13553286b68bbc980ebc4f3e1ee282bff2da9848a61d3 |
|
MD5 | bc2804cd42fdd89e6ec492ec0aa7c118 |
|
BLAKE2b-256 | 7c861bfce365b54c75f1e879530f5538e69c11b3dbac243c7f735480ef4372c8 |