Anyone out there who has successfully deployed from Windows. I can reliably get the development environment working, with ansible running from within the VM, but deploying to a digitalocean server just seems not possible. Any advice from people who have successful experience with this much appreciated. We’re getting to a situation where we are just going to have to leave automated deployment out of the equation, which feels like it is really missing the point!
Why? What have you tried?
Apologies for delayed response! Ansible doesn’t run in windows, so has to be run on the guest, that’s fine. I just can’t get it to actually run the playbook, it fails with the error…
ERROR: The file hosts/production is marked as executable, but failed to execute correctly. If this is not supposed to be an executable script, correct this with
chmod -x hosts/production.
I have tried correcting this as suggested but continue to get the same error. Curious if anyone has actually got this to work, as I’ve spent an age trying to look at workarounds and failing dismally.
I have successfully deployed to DO from a Windows 8.1 machine.
The error you’re getting has something to do with Windows messing up the file so that it does not execute properly in your VM.
Copy the hosts directory to a place that is exclusively available on the VM
cp hosts /srv/www/
I edited the deploy.sh file
And changed the following line
-DEPLOY_CMD="ansible-playbook -i hosts/$1 deploy.yml --extra-vars="site=$2""
To the new file path
+DEPLOY_CMD="ansible-playbook -i /srv/www/hosts/$1 deploy.yml --extra-vars="site=$2""
Then I executed the deploy command with the new hosts location
ansible-playbook -i /srv/www/hosts/ server.yml
If you receive a permission denied SSH error, follow this
I think I mentioned all the steps. Let me know if this doesn’t work
As a Windows user who is interested in a multisite install, I have decided that using Windows to run these programs is cumbersome and frustrating. So I’m trying to set up development VPS and use rsync so I can edit files from my Windows computer…
My biggest issue with using Windows is that as the size of my project gets bigger, the web server runs slower. I’m looking at minimum 5 second page load times.
I read somewhere that this has to do with synced folders
I also dread having to use vagrant destroy. Since you have to do a lot of updates in the VM, you will lose a ton of configuration settings necessary to get everything working in the first place.
The Landrush plugin for multisite also does not work on Windows, so hopefully you don’t need it.
Thanks for the message, much appreciated. Will check this out shortly.
I had previously posted regarding performance, which indeed made the development process unbearable. I have successfully resolved this using winnfs
$ vagrant plugin install vagrant-winnfsd
And amended the VagrantFile to set the synced_folder call for windows to use nfs
config.vm.synced_folder local_site_path(site), remote_site_path(name), owner: 'vagrant', group: 'www-data', mount_options: ['dmode=776', 'fmode=775']
config.vm.synced_folder local_site_path(site), remote_site_path(name), type: 'nfs'
You should find the performance is vastly better using this rather than shared folders.
This seriously needs to be added to the docs for Windows users.
My page loads are now nearly instant!
Check out my post here
I have created a script that handles most things that need to be configured in order to setup the sage theme and deploy to staging and/or production server.
The issue you mentioned above is taken care of by the script. It runs the solution I mentioned above automatically.
Do you have problems running gulp after setting this?
$ gulp [23:22:11] Using gulpfile /srv/www/site.com/current/web/app/themes/theme/gulpfile.js [23:22:11] Starting 'clean'... [23:22:11] 'clean' errored after 12 ms [23:22:11] Error: EIO, rmdir '/srv/www/site.com/current/web/app/themes/theme/dist' at Error (native)
Hi @DemaniClassic thanks for the link to your bash script. Looks like it will be helpful, I’ve not had a chance to try it as yet, as working on another project. Will give it a go soon, and report back.
I have this same problem as well after following this process. I have just been running
rm -rf dist/* on my vagrant box for now. Did you ever get this figured out?
I was able to make it work without that error by running gulp and gulp watch from
I also changed the project_pre_build_commands_local to the new location
Awesome thanks. Having issues with the nfs not working anymore. It mounst just fine, but hangs on the part where it changes folder permissions of current to vagrant:www-data.
So annoying, especially since it worked for a while.
Here’s a link to my vagrant file. Maybe it will help, particularly lines 59 & 60.
I’m on Windows and have bindfs installed btw.
It wasn’t that, I figured out what the issue was. I put
vagrant-winnfsd in debug log mode, and apparently it was choking on my
uploads folder. Some of the image folders had hundres (one had over 800 images). It was query and run the
NFS GETATTR and other methods like that, but when it got to those folders with a ton of images, screech to a crawl and read those directories over and over with no progress.
When I deleted those folders with a ton of images, everything worked perfectly. Not sure how to address that, or where to file a bug (with the vagrant winnfsd plugin or whoever built the EXE for winnfsd), but that was the issue.
Or maybe there’s a way I can setup winnfsd to not try and sync the uploads folders?
edit Just noticed you have a couple differences like using bindfs, and using nfs_path instead of remote_site_path. Trying that out now.