• Stars
    star
    2,140
  • Rank 20,834 (Top 0.5 %)
  • Language
    Python
  • License
    MIT License
  • Created about 10 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automation framework for programmers

ShutIt

Join the chat at https://gitter.im/ianmiell/shutit

A versatile automation framework.

ShutIt is an automation tool that models a user's actions on a terminal.

It can automate any process that can be run by a human on the command line with little effort.

It was originally written to manage complex Docker builds, but is a now general-purpose automation tool that supports bash, Docker, Vagrant, ssh and arbitrary build contexts.

ShutIt can also be used as an educational tool, as it can produce videos of demos, capture reproducible steps required to set environments up, and even challenge you to get the right output (see grep-scales).

If you want to know more about Docker, see the official site or take a look at the book by the creators of ShutIt - Docker in Practice.

Really Quick Overview

Some use cases:

  • You like bash, want to automate tasks, have structure and support, but don't want to learn a configuration management framework that takes you away from the command line you know and love.

  • Want to create complex Vagrant environments to model clusters of machines.

  • Want to create instructive walkthroughs:

  • Are interested in "phoenix deployment".

  • Want to take your scripts and turn them into stateless containers quickly, without needing to maintain (or learn) a configuration management solution designed for moving-target systems.

  • You're programmer who wants highly configurable stateless containers development, testing, and production.

  • Want to build everything from source in a way that's comprehensible and auditable.

What Does it Do (bash Builds)?

ShutIt acts as a modular and easy to use wrapper around pexpect.

Here is a simple example of a script that creates a file and a directory if they are not there already:

Simple Example

What Does it Do (Tutorials)?

This builds on the docker features (see below), but allows you to interrupt the run at points of your choosing with 'challenges' for the user to overcome.

Two types of 'challenge' exist in ShutIt:

  • scales
  • free form

Scales tell you to run a specific command before continuing. This is useful when you want to get certain commands or flags 'under your fingers', which does not happen without dedicated and direct practice.

grep Scales

Free form exercises give you a task to perform, and free access to the shell. This is to give the user a realistic environment in which to hone their skills. You can check man pages, look around the directories, search for useful utils (even install new ones!). When you are finished, a pre-specified command is run to check the system is in an appropriate state. Here's an example for the basics of git:

git 101 Tutorial

If you use a Docker-based tutorial and you mess the environment up, the state can be restored to a known one by hitting CTRL-G.

What Does it Do (Vagrant)?

Uses a bash build to set up n vagrant machines, and uses Landrush to give them useful hostnames accessible from the hosts and in the guest VMs.

It supports both Virtualbox and Libvirt providers.

This allows another kind of contained environment for more infrastructural projects than Docker allows for.

This example demonstrates a reproducible build that sets up Docker on an Ubuntu VM (on a Linux host), then runs a CentOS image within Docker within the Ubuntu VM.

It deposits the user into a shell mid-build to interrogate the environment, after which the user re-runs the build to add a directive to ensure ps is installed in the image.

Docker on Ubuntu VM running a CentOS image

Auto-Generate Modules

ShutIt provides a means for auto-generation of modules (either bare ones, or from existing Dockerfiles) with its skeleton command. See here for an example.

Really Quick Start

Full User Guide

API

Installation

Known Issues

Since a core technology used in this application is pexpect - and a typical usage pattern is to expect the prompt to return. Unusual shell prompts and escape sequences have been known to cause problems. Use the shutit.setup_prompt() function to help manage this by setting up a more sane prompt. Use of COMMAND_PROMPT with echo -ne has been seen to cause problems with overwriting of shells and pexpect patterns.

ScreenShot

Licence

The MIT License (MIT)

Copyright (C) 2014 OpenBet Limited

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

cheapci

Simple CI framework in bash. Checks whether there have been any updates, runs tests and mails you on completion.
Shell
180
star
2

jenkins-phoenix

Stateless Jenkins deployment with Docker
Shell
93
star
3

autotrace

Runs a process, and gives you the output along with other telemetry on the process, all in one terminal window.
Python
70
star
4

history-service

Shell
62
star
5

introduction-to-bash

Resources for the O'Reilly Course 'Introduction to Bash'
Shell
61
star
6

shutit_copyserver

Copy a server into a docker container using blueprint
Python
53
star
7

bad-dockerfile

A Dockerfile that creates an image with known vulnerabilities.
Dockerfile
48
star
8

shutitfile

Stupid-simple automation for everyone
47
star
9

shutit-k8s-the-hard-way

Python
46
star
10

pm-as-code

Makefile
42
star
11

gitdags

Create Your Own Git Diagrams
Shell
42
star
12

alert-on-change

Service that mails you when the output of a command changes
Python
37
star
13

util-templates

Shell
35
star
14

git-101-tutorial

Guided git intro in a real shell, using Docker
Python
29
star
15

bash-scripting-in-three-weeks

Shell
27
star
16

docker-sleep

Smallest Docker image I can muster
Assembly
27
star
17

bash2py

bash2py in a docker image, cf: http://www.swag.uwaterloo.ca/bash2py/index.html
27
star
18

introduction-to-the-command-line

Materials for O'Reilly course 'Introduction to the Command Line'
26
star
19

gitops-example

25
star
20

docker-101-tutorial

A guided tour of docker basics
Python
24
star
21

gitops-first-steps

21
star
22

shutit-distro

ShutIt Distribution based on Linux From Scratch
Python
19
star
23

bash-next-steps

Shell
18
star
24

docker-rosetta-stone

A set of rosetta stones for the Docker ecosystem
17
star
25

shutit-linux-dns

Python
16
star
26

grep-scales

Python
11
star
27

docker-dev-tools-image

My docker dev tools image, usable anywhere where docker is
Python
11
star
28

autopexpect

autoexpect for pexpect
Python
11
star
29

shutit-criu

Play with CRIU in vagrant, all automated.
Python
10
star
30

learn-docker-the-hard-way

Makefile
9
star
31

shutit-chef-env

Chef server within vagrant automatically set up
Python
8
star
32

git-app-patterns

Shell
8
star
33

shutit-orca-build

PoC of rootless container build on CentOS7
Python
8
star
34

llm_history_essay

Python
8
star
35

headless-chrome

example of headless chrome using Docker
JavaScript
7
star
36

learngitthehardway

7
star
37

shutit-unikernel-walkthrough

Walkthrough of hello world MirageOS unikernel creation as unix binary and xen image
Python
7
star
38

shutit-library

Shell
6
star
39

shutit-git-trainer

ShutIt git trainer
Python
6
star
40

terraform-dynamic-poc

Dynamic Terraform Environments PoC
Shell
6
star
41

sar_report

Create Ascii Graphs of sar Data With One Line
Awk
5
star
42

shutit-home-server

Groovy
5
star
43

shutit-scripts

Set of useful standalone shutit scripts
Python
5
star
44

simple-dockerfile

A trivial Dockerfile example for teaching purposes
Dockerfile
5
star
45

themortgagemeter

Code for themortgagemeter.com
HTML
5
star
46

shutit-vultr

Python
4
star
47

gitops-example-deploy

4
star
48

docker-compose-example

A trivial Fig example
Shell
4
star
49

docker-1_10

Walkthrough of docker 1.10 features
Python
4
star
50

gitops-example-app

Dockerfile
4
star
51

ZZshutit-home-desktop

My development server, built from scratch automatically as a VM
Python
4
star
52

shutit-openshift-cluster

Python
4
star
53

shutit-minikube

Python
3
star
54

git-rebase-tutorial

A ShutIt-based tutorial on git rebase.
Python
3
star
55

shutit-vpn-example

Python
3
star
56

shutit-faas

Python
3
star
57

Twitter-DNS

DNS alternative for IP lookup using twitter usernames
Python
3
star
58

share-tracker

PLpgSQL
3
star
59

shutit-jenkins-plugin-dev

Environment to set up a basic Jenkins plugin
Python
3
star
60

shutit-gvisor

Python
3
star
61

learn-shutit-the-hard-way

Tutorial for ShutIt following "hard way" model
JavaScript
3
star
62

shutit-test

HTML
2
star
63

shutit-docker-1_9

Tour of Docker 1.9's features
Python
2
star
64

shutit-openshift-vm

OpenShift VM
Python
2
star
65

jq-examples

Shell
2
star
66

shutit-kerberos-docker

Python
2
star
67

shutit-coreos-vagrant

CoreOS Vagrant Module
Python
2
star
68

word_counts

Calculation of vocabulary using Porter stemming of writers based on their corpuses
2
star
69

shutit-docs

HTML
2
star
70

gogs_shutit

ShutIt module for building gogs https://github.com/gogits/ http://ianmiell.github.io/shutit/
Python
2
star
71

shutit-hadoop

Quick setup of hadoop using ShutIt
Python
2
star
72

shutit-netnamespaces-intro

Intro to network namespaces with an OpenVSwitch switch
Python
2
star
73

shutit-openscap-demo

Demo of docker-oscap functionality for checking images for cves
Python
2
star
74

local-info

Display information gathered from multiple services about locally useful information, eg next bus times
Python
2
star
75

shutit-kaniko

Python
2
star
76

dec

HTML
2
star
77

shutit-docker-multihost

Implementation of: https://wiredcraft.com/blog/multi-host-docker-network/
Python
2
star
78

NS-I-Lookup

Script to save time filling forms to get NS&I index-linked certificate values out each month
Python
2
star
79

shutit-docker-demo

A demo of basic docker functionality using ShutIt
Python
1
star
80

docker-glacier

Glacier boto setup
1
star
81

shutit-sed-awk

Introduction to some basic shell commands
Python
1
star
82

docker-jira

Shell
1
star
83

gtd-public

Shell
1
star
84

git-bisect-tutorial

A guided usage of git bisect in a safe (Docker) environment
Python
1
star
85

OLD-shutitdist

C
1
star
86

shutit-vagrant-docker-experimental

Vagrant setup of docker experimental binary
Python
1
star
87

docker-selinux

Python
1
star
88

jhalfs-lfs-docker

Files needed to build a LFS Docker Image using jhalfs
1
star
89

airlock

1
star
90

bash_startup

Dockerfile
1
star
91

kubernetes-play

Kubernetes fun with docker
Shell
1
star
92

shutit-shell-trainer

Shell trainer
Python
1
star
93

simple_mailer

As simple a gmail mailer as I could write
Python
1
star
94

btsync

A btsync image
ApacheConf
1
star
95

photogrammetry

HCL
1
star
96

base91

1
star
97

actions-play

1
star
98

pimpbash

C
1
star
99

propertymaps

Code from ca. 2005 mapping properties for sale using google maps
Python
1
star
100

net-tools

Dockerfile
1
star