Created
October 21, 2015 13:51
-
-
Save AtsushiSuzuki/880859d70d773af614c8 to your computer and use it in GitHub Desktop.
VagrantでNode.js用ソースディレクトリをunionfs-fuseでマウントするテスト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sqlite3 = require('sqlite3'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "aufs-test", | |
"version": "0.0.0", | |
"description": "", | |
"author": "", | |
"main": "index.js", | |
"license": "", | |
"dependencies": { | |
"sqlite3": "^3.1.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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