mach

command module
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: MIT Imports: 1 Imported by: 0

README

Mach

Website | Discussions | Documentation | Twitter | Installation Guide | Contribution Guide

Mach is a cli application for using docker to quickly and easily manage infrastructure and services through code.

GoDoc Go Go Report Card codecov

Mach provides tooling around a simple docker and docker-machine based workflow for managing infrastructure, services and docker images. This allows you to easily leverage any git repository for the purposes of managing your Infrastructure as Code.

This project is written in golang, using cobra. Check the wiki for additional documentation and user guides.

Installation

Mach is a simple command-line tool and only one executable.

  • You can grab it from the releases page, and use it as-is.
    • You can also copy it to any directory and run it directly. You can even commit it and invoked directly i.e. bin/mach
    • It can also be installed to a $PATH and used globally i.e. cp ~/Downloads/mach /usr/local/bin/mach && chmod +x /usr/local/bin/mach

If you prefer to compile from source, the Makefile can be used:

git clone git@github.com:superterran/mach.git 
cd mach
make install # runs `go build .` and copies to /usr/local/bin

Managing Docker Machines

Mach can be used to backup docker-machine certificates and configurations to Amazon S3 buckets. This makes sharing docker-machine credentials with teammates (and pipelines) simple.

AWS authentication is performed through the golang library, which provides a variety of ways to authenticate. You can use a tool like aws-vault, ~/.aws/credentials files or environment variables such as:

$ export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
$ export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
$ export AWS_DEFAULT_REGION=us-west-2

Building Docker Images

Maintain a collection of docker images that can be rapidly built and pushed to a registry. Dockerfiles can be made using templates supporting includes, conditionals, loops, etc. mach build can build these images, and tag them based on git branch and filename conventions. This allows for maintaining a mainline image for public use, and versions for test.

Managing Docker Compositions

This tool also provides a thin wrapper around the docker-compose command, and will process docker-compose.yml.tpl files before passing them to compose. The compose command can run against any one composition, or against all of them in sequence to allow for managing everything in one command.

Contributing

For a complete guide to contributing to Mach, see the Contribution Guide

Bug reports and pull requests are welcome on GitHub at https://github.com/superterran/mach/issues.

License

Mach is released under the MIT License

Author Information

This project was started in 2021 by Doug Hatcher superterran@gmail.com.

Documentation

Overview

Mach is a cli application for using docker to quickly and easily manage infrastructure and services through code.

Mach provides tooling around a simple docker and docker-machine based workflow for managing infrastructure, services and docker images. This allows you to easily leverage any git repository for the purposes of managing your Infrastructure as Code.

Directories

Path Synopsis
Cmd backup copies docker-machine certs and configurations to S3 Cmd build generates docker images, using templates, and pushes them to a registry Cmd compose is a passthru for `docker compose` command that supports templates Cmd restore copies docker-machine certs and configurations from S3 and applies them to the host
Cmd backup copies docker-machine certs and configurations to S3 Cmd build generates docker images, using templates, and pushes them to a registry Cmd compose is a passthru for `docker compose` command that supports templates Cmd restore copies docker-machine certs and configurations from S3 and applies them to the host

Jump to

Keyboard shortcuts

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