Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Parallels Desktop #479

Merged
merged 3 commits into from
Jan 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ Vagrant.configure("2") do |config|
v.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end

# Configuration options for the Parallels Provider
config.vm.provider :parallels do |v|
v.update_guest_tools = true
v.optimize_power_consumption = false
v.memory = 1024
end

# Forward Agent
#
# Enable agent forwarding on vagrant ssh commands. This allows you to use identities
Expand All @@ -30,6 +37,11 @@ Vagrant.configure("2") do |config|
# to your host computer, it is cached for future use under the specified box name.
config.vm.box = "ubuntu/trusty64"

# The Parallels Provider uses a different naming scheme.
config.vm.provider :parallels do |v, override|
override.vm.box = "parallels/ubuntu-14.04"
end

config.vm.hostname = "vvv"

# Local Machine Hosts
Expand Down Expand Up @@ -111,6 +123,13 @@ Vagrant.configure("2") do |config|
else
config.vm.synced_folder "database/data/", "/var/lib/mysql", :extra => 'dmode=777,fmode=777'
end

# The Parallels Provider does not understand "dmode"/"fmode" in the "mount_options" as
# those are specific to Virtualbox. The folder is therefore overridden with one that
# uses corresponding Parallels mount options.
config.vm.provider :parallels do |v, override|
override.vm.synced_folder "database/data/", "/var/lib/mysql", :mount_options => []
end
end

# /srv/config/
Expand Down Expand Up @@ -138,6 +157,13 @@ Vagrant.configure("2") do |config|
config.vm.synced_folder "www/", "/srv/www/", :owner => "www-data", :extra => 'dmode=775,fmode=774'
end

# The Parallels Provider does not understand "dmode"/"fmode" in the "mount_options" as
# those are specific to Virtualbox. The folder is therefore overridden with one that
# uses corresponding Parallels mount options.
config.vm.provider :parallels do |v, override|
override.vm.synced_folder "www/", "/srv/www/", :owner => "www-data", :mount_options => []
end

# Customfile - POSSIBLY UNSTABLE
#
# Use this to insert your own (and possibly rewrite) Vagrant config lines. Helpful
Expand Down
4 changes: 3 additions & 1 deletion provision/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,11 @@ else
echo -e "\nMySQL is not installed. No databases imported."
fi

# Run wp-cli as vagrant user
# Run wp-cli, tar, and npm as `vagrant` user instead of `root`
if (( $EUID == 0 )); then
wp() { sudo -EH -u vagrant -- wp "$@"; }
tar() { sudo -EH -u vagrant -- tar "$@"; }
npm() { sudo -EH -u vagrant -- npm "$@"; }
fi

if [[ $ping_result == *bytes?from* ]]; then
Expand Down