diff --git a/.gitignore b/.gitignore index fc499ff..f5fc507 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules lib +.vagrant config.json npm-debug.log diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..1c4b19d --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,25 @@ +Vagrant.configure("2") do |config| + config.vm.box = "ubuntu/xenial64" + + config.vm.network :private_network, ip: '10.76.91.201' + config.vm.hostname = "jukebox.pi" + + # https://gist.github.com/millisami/3798773 + def local_cache(box_name) + cache_dir = File.join(File.dirname(__FILE__), '.vagrant-cache', 'apt', box_name) + partial_dir = File.join(cache_dir, 'partial') + FileUtils.mkdir_p(partial_dir) unless File.exists? partial_dir + cache_dir + end + + cache_dir = local_cache(config.vm.box) + config.vm.synced_folder cache_dir, "/var/cache/apt/archives" + + config.vm.provision "shell" do |s| + s.inline = "sudo apt update -y" + s.inline = "sudo apt upgrade -y" + s.inline = "sudo apt install -y make nodejs npm nodejs-legacy" + end +end + +# vim:set ts=2 sw=2 et: diff --git a/bin/mpg321 b/bin/mpg321 new file mode 100755 index 0000000..9867004 --- /dev/null +++ b/bin/mpg321 @@ -0,0 +1,5 @@ +#!/bin/bash + +while read line ; do + echo "OK" +done diff --git a/bin/tag-reader b/bin/tag-reader new file mode 100755 index 0000000..6edc405 --- /dev/null +++ b/bin/tag-reader @@ -0,0 +1,5 @@ +#!/bin/bash + +while date +%s ; do + sleep 5 +done diff --git a/config.json.vagrant b/config.json.vagrant new file mode 100644 index 0000000..938cb84 --- /dev/null +++ b/config.json.vagrant @@ -0,0 +1,6 @@ +{ + "port": "8080", + + "tag_reader": ["./bin/tag-reader"], + "mpg321": ["./bin/mpg321"] +}