Skip to content

Instantly share code, notes, and snippets.

@stevegt
Last active January 17, 2020 02:04
Show Gist options
  • Save stevegt/07ab45b148e6a3e44cf91062960ccd0c to your computer and use it in GitHub Desktop.
Save stevegt/07ab45b148e6a3e44cf91062960ccd0c to your computer and use it in GitHub Desktop.
the hack
#!/bin/bash -ex
# any setup bits go here -- set env variables, etc.
makefile=$PWD/Makefile
mkdir -p /var/is/stamps
cd /var/is/stamps
make -f $makefile $(hostname)
# these are hostnames
kirk: d4-0
scotty: d4-2
spock: d4-1 vim
# could also use pattern-matching for hostnames
%.dev.example.com: d4-2
# d4-x are image names, where x is the image version
d4-0: docker-18.09.7 nfs-client
d4-1: d4-0 consul-1.6.0 jq
d4-2: d4-1 vim rsync netcat autossh autofs sshfs tcpdump socat dnsutils screen mosh
# other variations: make use of env and per-target vars, VPATH, etc.
docker-18.09.7:
apt install -y docker.io
touch $@
nfs-client:
apt-get install -y nfs-common
apt-get install -y autofs
mkdir /net
touch $@
consul-1.6.0:
cp -a images/consul_1.6.0_linux_amd64 /usr/bin/consul
consul version
touch $@
jq vim rsync netcat autossh autofs sshfs tcpdump socat dnsutils screen mosh:
apt-get install -y $@
touch $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment