Skip to content

Instantly share code, notes, and snippets.

@AtsushiSuzuki
Created October 21, 2015 13:51
Show Gist options
  • Save AtsushiSuzuki/880859d70d773af614c8 to your computer and use it in GitHub Desktop.
Save AtsushiSuzuki/880859d70d773af614c8 to your computer and use it in GitHub Desktop.
VagrantでNode.js用ソースディレクトリをunionfs-fuseでマウントするテスト
var sqlite3 = require('sqlite3');
{
"name": "aufs-test",
"version": "0.0.0",
"description": "",
"author": "",
"main": "index.js",
"license": "",
"dependencies": {
"sqlite3": "^3.1.0"
}
}
Vagrant.configure(2) do |config|
config.vm.box = 'ubuntu/trusty64'
config.vm.provision 'shell', inline: <<-SCRIPT
curl -sL https://deb.nodesource.com/setup_4.x | bash
apt-get upgrade -y
apt-get install -y nodejs build-essential unionfs-fuse
SCRIPT
config.vm.provision 'shell', privileged: false, inline: <<-SCRIPT
mkdir ~/.src ~/src
unionfs-fuse -o cow ~/.src=RW:/vagrant=RO ~/src
cd ~/src; npm install; npm rebuild
SCRIPT
config.vm.provision 'shell', run: 'always', privileged: false, inline: <<-SCRIPT
fusermount -u ~/src || true
unionfs-fuse -o cow ~/.src=RW:/vagrant=RO ~/src
SCRIPT
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment