Giter Site home page Giter Site logo

ghstat's Introduction

Latest Version

License

Downloads

Code Health

Introduction

This command-line application is mainly for continuous build and integration environments. It allows providing all of the details necessary to mark the status of a commit. For pull requests, it may read "All is Well" or "Merge with Caution" with an optional hyperlink to the CI build server, and optional description of the build failure.

This is done using the Github v3 API.

This is not a very serious package, there are not any plans to advance it further. It was authored because existing github python client packages such as pygithub3 did not offer the ability to communicate with the 'statuses' api endpoints, and it is preferred to provide well-readable command-line arguments in the build script than to use curl directly.

Installation

The stable version of this package is maintained on pypi, install using pip:

pip install ghstat

Generate a personal access token, https://github.com/settings/applications, enabling scope repo:status and public_repo or private_repo, respectively.

Use this token for the --token parameter, or as the environment variable GITHUB_APP_TOKEN

Examples

Failing a build on github.com:

ghstat.py set --token 0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d \
              --commit 72b74be0de46392a05d8f470b64272b8036e63f8 \
              --user jquast --repo ghstat --state success

Retrieving the status of a commit as json data to stdout:

ghstat.py get --token 0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d \
              --commit 72b74be0de46392a05d8f470b64272b8036e63f8 \
              --user jquast --repo ghstat

Linking to a private bamboo and github enterprise account:

ghstat.py set --token 0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d \
              --commit 0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a \
              --user jquast \
              --repo ghstat \
              --state success \
              --description 'build successful' \
              --target-url 'https://bamboo.mycorp.com/browse/PROJ-BUILD10-1' \
              --base-url 'https://github.mycorp.com/api/v3/'

Others

githubdate: Same thing, only it uses an .ini file instead of cmd-line parameters.

Changes

0.3.1
0.3.0
  • For descriptions of length greater than 140, truncate and emit a warning to standard error. It will be changed to a length of 140 ending in text marker (...).
0.2.0
  • Support python 3
  • Support token as environment value GITHUB_APP_TOKEN
  • Resolve IndexError when retrieving status for a commit without any.
0.1.0
  • Initial release to pypi

ghstat's People

Contributors

jquast avatar kad avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.