Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Latest commit

 

History

History
133 lines (96 loc) · 3.25 KB

README.md

File metadata and controls

133 lines (96 loc) · 3.25 KB

🚦 semaphore

Tool to execute terminal commands in parallel.

Build Template

💡 Idea

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

Full description of the idea is available here.

🏆 Motivation

...

🤼‍♂️ How to

asciicast

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

Homebrew

$ brew install kamilsk/tap/semaphore

Binary

$ curl -sSL https://bit.ly/install-semaphore | sh
# or
$ wget -qO- https://bit.ly/install-semaphore | sh

Source

# use standard go tools
$ go get -u github.com/kamilsk/semaphore
# or use egg tool
$ egg tools add github.com/kamilsk/semaphore

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.


made with ❤️ for everyone