Skip to content

Instantly share code, notes, and snippets.

@erikh
Created October 31, 2016 23:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save erikh/5f6e47225e541382a20cdf91d873d8cf to your computer and use it in GitHub Desktop.
Save erikh/5f6e47225e541382a20cdf91d873d8cf to your computer and use it in GitHub Desktop.
from "ubuntu"
myuser = "erikh"
homedir = "/home/#{myuser}"
packages = %w[
man
ack-grep
zsh
tmux
build-essential
vim-nox
git
mercurial
ruby-full
curl
flex
bison
sudo
keychain
]
go_packages = %w[
github.com/MaximeD/gost
github.com/erikh/gisto
github.com/aktau/github-release
]
go_packages_download = %w[
github.com/erikh/box
]
go_version = "1.7.3"
run "apt-get update"
run "apt-get dist-upgrade -y"
run "apt-get install -y #{packages.join(" ")}"
run "curl -sSL https://storage.googleapis.com/golang/go#{go_version}.linux-amd64.tar.gz | tar -xvz -C /usr/local"
run "curl -sSL https://get.docker.com | bash"
run %Q[echo "#{myuser} ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers]
# staff is what the docker sock will come in as when bind mounted
run "useradd #{myuser} -G docker,sudo,staff -s /bin/zsh -m -d #{homedir}"
user myuser
workdir homedir
copy ".", "config"
env "TERM" => "xterm-256color",
"GOPATH" => "/home/#{myuser}",
"PATH" => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"
with_user "root" do
run "chown -R #{myuser}:#{myuser} config"
end
inside "#{homedir}/config" do
run "sh setup.sh"
end
run "vim -c 'set nomore' +PluginUpdate +qall"
run "vim -c 'set nomore' +GoInstallBinaries +qall"
go_packages.each { |pkg| run "go get -u '#{pkg}'" }
go_packages_download.each { |pkg| run "go get -d -u '#{pkg}'" }
inside "#{homedir}/src/github.com/erikh/box" do
run "git remote set-url origin git@github.com:erikh/box"
end
set_exec cmd: ["/bin/zsh", "-l"], entrypoint: []
tag "dev"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment