semaphore

command
v0.0.0-...-a5ea77e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2019 License: MIT, MIT Imports: 20 Imported by: 0

README

🚦 cmd/semaphore

semaphore provides functionality to execute terminal commands in parallel.

Awesome Patreon Build Status Code Coverage Code Quality GoDoc Research License

Concept

$ semaphore create 2
$ semaphore add -- docker build
$ semaphore add -- vagrant up
$ semaphore add -- ansible-playbook
$ semaphore wait --timeout=1m --notify

asciicast

Documentation

Usage: semaphore COMMAND

Semaphore provides functionality to execute terminal commands in parallel.

Commands:

create	is a command to init a semaphore context
  -debug
    	show error stack trace
  -filename string
    	an absolute path to semaphore context (default "/tmp/semaphore.json")


add	is a command to add a job into a semaphore context
  -debug
    	show error stack trace
  -edit
    	switch to edit mode to read arguments from input (not implemented yet)
  -filename string
    	an absolute path to semaphore context (default "/tmp/semaphore.json")


wait	is a command to execute a semaphore task
  -debug
    	show error stack trace
  -filename string
    	an absolute path to semaphore context (default "/tmp/semaphore.json")
  -notify
    	show notification at the end (not implemented yet)
  -speed int
    	a velocity of report output (characters per second)
  -timeout duration
    	timeout for task execution (default 1m0s)

Version 4.0.0 (commit: ..., build date: ..., go version: go1.9, compiler: gc, platform: darwin/amd64)
Complex example
$ semaphore create 2
$ semaphore add -- bash -c "cd /tmp; \
    git clone git@github.com:kamilsk/semaphore.git \
    && cd semaphore \
    && echo 'semaphore at revision' \$(git rev-parse HEAD) \
    && rm -rf /tmp/semaphore"
$ semaphore add -- bash -c "cd /tmp; \
    git clone git@github.com:kamilsk/retry.git \
    && cd retry \
    && echo 'retry at revision' \$(git rev-parse HEAD) \
    && rm -rf /tmp/retry"
$ semaphore wait

Installation

Brew
$ brew install kamilsk/tap/semaphore
Binary
$ export REQ_VER=4.0.0  # all available versions are on https://github.com/kamilsk/semaphore/releases
$ export REQ_OS=Linux   # macOS and Windows are also available
$ export REQ_ARCH=64bit # 32bit is also available
$ curl -sL -o semaphore.tar.gz \
       https://github.com/kamilsk/semaphore/releases/download/"${REQ_VER}/semaphore_${REQ_VER}_${REQ_OS}-${REQ_ARCH}".tar.gz
$ tar xf semaphore.tar.gz -C "${GOPATH}"/bin/ && rm semaphore.tar.gz
From source code
$ egg github.com/kamilsk/semaphore@^4.0.0 -- make test install
$ # or use mirror
$ egg bitbucket.org/kamilsk/semaphore@^4.0.0 -- make test install

egg1 is an extended go get.

Bash and Zsh completions
$ semaphore completion bash > /path/to/bash_completion.d/semaphore.sh
$ semaphore completion zsh  > /path/to/zsh-completions/_semaphore.zsh

1 The project is still in prototyping.


Gitter

made with ❤️ by OctoLab

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL