Skip to content

Lachlan-S/dab

 
 

Repository files navigation

Dab

standard-readme compliant GitHub license CircleCI Build Status

The Developer lab.

Try in PWD

Dab is a flexible tool for managing multiple interdependent projects and their orchestration, all while providing a friendly user experience and handy devops tools.

Table of Contents

Install

Simply download the dab wrapper script to somewhere in your PATH environment variable, for example:

 $ sudo curl https://raw.githubusercontent.com/Nekroze/dab/master/dab -o /usr/local/bin/dab
 $ sudo chmod 755 /usr/local/bin/dab

After this the dab command should be available in your shell:

 $ dab completion

If you are an OSX user you will want to set the DAB_GID environment variable to 0 to avoid docker access issues and the DAB_AUTOUPDATE_COMPLETION environment variable to false as completion is only supported on Linux out of the box.

Usage

You need only have docker installed and any POSIX compliant shell to run the wrapper scripts and get going with dab. This will start the dab container and forward all arguments into it:

 $ dab --help

If you do not need to build the docker image yourself and just want to use dab, the dab script we just executed is all that is needed and can be used from (or moved to) any location.

It is recommended you add the directory containing the dab script to your shell's PATH environment variable.

Demoing

If you are not yet sure if Dab is right for you, Play With Docker (PWD) will allow you to spin up a temporary cloud server with Dab available. You will be presented with a terminal containing the latest version of Dab ready to use.

Setting up a project

As a developer I work on a heaps of projects each with their own needs and quirks. Lets use dab to manage a project for us, first we need to register its existence:

 $ dab repo add containaruba https://github.com/Nekroze/containaruba.git

This will register the containaruba repository and attempt to clone it into $DAB_REPO_PATH which defaults to ~/dab.

Now we can set the type of entrypoint we want this repo to use.

 $ dab repo entrypoint create containaruba
 $ dab config add repo/containaruba/entrypoint/start ./test.sh

Now whenever we start this repo, or a repo that depends upon this one, the test.sh script within the root of the containaruba repo will be executed.

 $ dab repo entrypoint start containaruba

Using dockerized apps

There is an ever growing selection of tools and services dab provides (checkout dab apps list) for recording metrics, databases, etc.

 $ dab apps start grafana
 $ dab apps start ntopng
 $ dab apps start redis

Updating

Dab has a self updating mechanism in that it will pull the latest version of the dab image when dab is next executed a day or more after the last time it checked. So generally you do not have to do anything at all to stay up to date with the latest features, bug fixes, and security improvements. This new image will update the wrapper script if necessary.

Watching and Learning

The Dab UX project stores user experience tests that should almost always be added to and not modified or removed. This allows for a stable command line interface with a clear notification if that interface changes in the form of changes to that project. Each version of Dab itself is tested against the current tests in Dab UX before released to ensure no regression. These tests are also used to generate the Dab UX Website where you can learn more about what Dab can do for you.

Features

  • Only depends on docker and a small wrapper script
  • Manage code repositories
  • Manage entrypoints into repositories eg. starting and stopping a project
  • Easy tool access like CyberChef
  • Easy service access like Redis
  • Auto update of dab image
  • Setup of private lab network
  • Automatically collect logs to explore via TICK and Logspout
  • Automatically update out of date wrapper script
  • Groups allow combining repositories, and even groups to be orchestrated together
  • Shared base image, most all docker container dab uses utilize an alpine base image that is lean
  • Simple, thanks to the subcommander dispatcher most subcommands are implemented in only a few SLOC
  • Tree structured configuration that can be shared (eg. via git or tar)
  • Managed x509 PKI

Contributing

If you would like to help hone dab into a better tool check out our contributing documentation.

Bill Of Materials

The following projects are used to write dab:

Maintainers

@Nekroze

Contributing

See the contributing file!

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

GPLv3 © 2018 Taylor Lawson

Releases

No releases published

Packages

No packages published

Languages

  • Shell 60.3%
  • Gherkin 23.0%
  • Go 8.8%
  • Dockerfile 5.7%
  • JavaScript 1.4%
  • Ruby 0.6%
  • HCL 0.2%