Giter Site home page Giter Site logo

build-status's Introduction

build-status

Emacs minor mode that shows a buffer's build status in the mode line.

build-status example running build-status example passing build-status example failing

Installation

From MELPA

Run M-x package-install build-status

Manual installation

Add build-status.el's directory to load-path

(require 'build-status)
(put 'build-status-mode-line-string 'risky-local-variable t)

Usage

M-x build-status-mode in a buffer that's part of a CI project.

By default the build status will be checked every 5 minutes. To change this set build-status-check-interval to the desired interval, in seconds.

API tokens can be set via the service-specific variable (see below) or via git config:

git config --add build-status.api-token TOKEN

To open the CI service's web page for buffer's build click on the mode's lighter or run M-x build-status-open.

Status Mapping

build-status will try to convert the CI service's status to one of the following:

  • failed
  • passed
  • queued
  • running

This is done via the service's status mapping alist.

If the status is not mapped it's treated as unknown (lighter is "?" and mouseover shows the status as is). You can ignore a status by mapping it to the symbol ignored.

See the Supported Services section below for more information.

Status Mode Line Faces

Each status indicator has an associated face. They're are listed below.

If you'd like to change the color and/or style of an indicator just update the appropriate face.

You can add a face for an unsupported status by creating a face named build-status-STATUS-face where STATUS is the name of the status with non-word characters replaced by "-".

build-status-face

All faces inherit from this face.

Attributes: none

build-status-failed-face

Attributes: :background "red"

build-status-passed-face

Attributes: :background "green"

build-status-queued-face

Attributes: :background "yellow"

build-status-running-face

Attributes: :background "yellow"

build-status-unknown-face

Used when the build status returns an unknown value. For more info see status mapping.

Attributes: none

Supported Services

CircleCI

The buffer's directory or one of its ancestors must contain a circle.yml file or .circleci directory.

To set a token (but also see git config tokens):

(setq build-status-circle-ci-token "YOUR-TOKEN")

Status mapping is controlled via build-status-circle-ci-status-mapping-alist. It defaults to:

'(("infrastructure_fail" . "failed")
  ("not_running" . "queued")
  ("success" . "passed")
  ("scheduled" . "queued")
  ("timedout" . "failed"))

Travis CI

The buffer's directory or one of its ancestors must contain a .travis.yml file.

To set a token (but also see git config tokens):

(setq build-status-travis-ci-token "YOUR-TOKEN")

Status mapping is controlled via build-status-travis-ci-status-mapping-alist. It defaults to:

'(("errored" . "failed")
  ("started" . "running")
  ("created" . "queued"))

By default, the open source Travis CI (travis-ci.org) is used. To use the pro or enterprise versions, set the build-status-travis-ci-domain variable to travis-ci.com, or the domain of your enterprise instance. If you have projects in both, directory variables are a good way to set up domain and token on a per-project basis.

TODOs

  • Support for Enterprise GitHub
  • Support for VCS mode hooks
  • Support for AppVeyor

See Also

Author

Skye Shaw [skye.shaw AT gmail.com]

build-status's People

Contributors

porras avatar sshaw avatar tarsius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

build-status's Issues

don't error if network down?

Emacs tells me Failed to update status for /tmp/foo: HTTP/1\.[01] \([0-9]\{3\}\) whenever I open my laptop, since there's a slight delay until wifi connects. I don't think this calls for an something as invasive as an error (which shows even if you haven't looked at a CI-tracked project in hours). How about a special ((string= status "status unavailable") (build-status--propertize "?" status)) or something like that?

global-build-status-mode

Would it be possible to make a global mode, that simply searches for a parent .travis.yml for every buffer with a file associated?

Build mode from arbitrary magit status page?

Hello, thank you for the great module. This is more out of curiosity but I was wondering if it is possible to (and how you can approach) have the build-mode status badge in my magit buffer. It is where i generally am thinking about if the build is done or not.

I see in code, build-status looks at buffer-file-name, which is nil for magit (and shells, etc). So I assuming one way is for me to redefine that method. But I was wondering if:

  1. there were other ways you would suggest to accomplish
  2. if it would make sense to support a customizable map that users could point to. I'm new to emacs-lisp so this is more psuedo-code but something like
(defun project-from-map (buffer-name)
(("magit: web" "/Users/jskulski/Code/web/") 
  (/.*e-shell.*/ " (ask-eshell-for-cwd) ;; This is above my head now, but maybe we could functions or regular expressions 
)

I am using projectile if that changes any suggestions. Thanks again!

Support for CircleCI Workflows

Upon a surface-level evaluation, it doesn't look like the status of CircleCI workflows is accurately represented, i.e. if the overall workflow fails but the final build of the workflow passes, the represented build status is passing. I'm happy to try implementing support for this if my read of things is correct.

Thanks for your work on this!

How to connect this to doom-modeline

Hi there,

Apologies if this is a silly question, but does this package work with doom-modeline? How would I configure doom-modeline to add the build status?

Thanks
JH

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.