Add serve script to vagrantfile

pull/11/head
Matthew Strasiotto 4 years ago
parent 433353c70f
commit a9ad558316

@ -25,7 +25,6 @@ Vagrant.configure("2") do |config|
apk update && \
apk add -u $build_deps $runtime_deps && \
# adduser -D -H -h / -u $user_id tty-server && \
cd /go/src/github.com/elisescu/tty-server && \
GOPATH=/go dep ensure && \
GOPATH=/go make all && \
@ -33,9 +32,19 @@ Vagrant.configure("2") do |config|
rm -r /go && \
apk del $build_deps
SCRIPT
$serve_script = <<-SCRIPT
cat <<-EOF > /usr/bin/serve
#!/usr/bin/env bash
URL="${1:-http://localhost:5000}"
/usr/bin/tty-server -web_address :5000 --sender_address :6543 -url "$URL"
EOF
chmod a+x /usr/bin/serve
SCRIPT
config.vm.provision "file", source: ".", destination: "$HOME/go/src/github.com/elisescu/tty-server"
config.vm.provision "shell", inline: 'mv "/home/vagrant/go" "/go"'
config.vm.provision "shell", inline: $install_script
config.vm.provision "shell", inline: $serve_script
end

Loading…
Cancel
Save