Giter Site home page Giter Site logo

jobrunner's Introduction

job

Job runner with logging

Build Status PyPI Release

Installation

Install system-wide:

$ pip install shell-jobrunner

Install just for the current user:

$ pip install --user shell-jobrunner

Uninstallation

$ pip uninstall jobrunner

Examples

  • Run sleep 5 in the background

    $ job sleep 5
  • Run ls when the last job finishes and it passed (exit code 0)

    $ job -B. ls
  • Run ls when last job finishes (pass / fail)

    $ job -b. ls
  • Monitor job execution

    $ job -W
    Sat Aug 10, 2019 20:48:23  No jobs running, load: 0/0/0
  • Retry a job

    $ job --retry ls

Query Examples

NOTE . is available as an alias to the most recently executed job (as in the Examples above).

  • View recently executed job log file

    $ job ls
    $ view `job`   # Opens the output from ls using "view"
  • View two most recently executed

    $ job echo 1
    $ job echo 2
    $ view `job -n0 -n1`
  • Query by job name

    $ job echo foo
    $ job echo bar
    $ view `job -g foo`
  • Show job info by name

    $ job ls
    $ job -s ls

Configuration

The default configuration file location is ~/.config/jobrc, but can be
overridden using the --rc-file option.

Sample rcfile:

[mail]
program = mail
# For notifications over chat applications (like Google Chat), use chatmail as
# your mail program instead. "chatmail" must be specified rather than a differently
# named link to the script, else some options provided to job (such as --rc-file)
# will not be passed through to it.
# program = chatmail
domain = example.com
[ui]
watch reminder = full|summary  # default=summary
[chatmail]
at all = all|none|no id # default=none
reuse threads = true|false # default true
[chatmail.google-chat-userhooks]
user1 = https://chat.googleapis.com/v1/spaces/...
[chatmail.google-chat-userids]
# Retrieve this using your browser inspector on an existing mention of this user.
# It should show up as "user/some_long_integer" somewhere in the span's metadata.
user1 = <long integer>

Hacking

Primary workflow

It's highly recommend to work inside a virtualenv using pipenv.

Create new virtualenv and install an editable version of jobrunner:

pipenv --three install --dev
pipenv run pip install -e .

Autoformat the code and check linters:

pipenv run ./format.sh

Run tests:

pipenv run pytest

Run CI checks locally

This allows you to run something similar to the azure pipelines locally using docker.
It will use PIP_INDEX_URL and / or ~/.config/pip/pip.conf to configure a pypi mirror.
This will also update Pipfile*.lock.
./test-docker.py [--versions 2.7 3.7 3.8] [--upgrade] [--ignore-unclean]

jobrunner's People

Contributors

wwade avatar dependabot[bot] avatar wade-arista avatar tsiemens avatar

Watchers

James Cloos 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.