Strange behaviour after deploy (images not displayed on production dist folder and need to run gulp again locally)

After following along this great guide you made with the roots-example-project I was able to connect to my ec2 instance, provision and deploy my website.

The thing is that everytime I use the deploy command (following @swalkinshaw suggestions with project_pre_build_commands_local and project_local_files) images uploaded to the dist folder does not display at the production server, although being there) and my local development “dist” folder dissapears, meaning I have to run gulp again in order to display the correct site on my computer.

Any idea what might be happening? I’m sure it’s something to do with permissions or something I might be running incorrectly during deployment, but it’s freaking me out.

Thanks anyone who can give a hand on this.

2nd problem is weird and I can’t think of why that’s happening. Maybe @fullyint might have an idea.

For the first problem, what does “not displaying” mean? 404s? 403 errors? Maybe a permissions thing?

Thanks for the answer, Scott. Yes, the second it’s a 403 error, forbidden. The images are in the dist folder but not being displayed.

Also no errors are shown when deploying with the deploy.sh script.

Locally, I’m working with a vagrant box. Deploying from my local terminal (not from vagrant). Just to make things clear. Should I install gulp and bower on the vagrant box or it isn’t necessary?

I’m waiting eagerly for your team next screencast. Hope in the meantime to find an answer to this. I’m almost there.

Thanks!

Scott or anyone around the forum, I’ve been investigating deeper into this issue. Sorry if I ask something stupid.

For the first issue (gulp --production on dev mode)
When you run the deploy.sh command, before copying to production using “pre_build_commands_local”, gulp --production is called on the local server, which is on delevopment mode. When running gulp --production every file around the dist folder is rebuild with a string after each filename (eg. main-3eaa3e5f.css) and that’s why when on dev mode no main.css (for example) is found on the dist folder. You have to run gulp again in order to find this files.

Second Issue (permission errors on dist/images)
I don’t know why, but when copying the files to production server (ec2 instance), the images on dist/images folder get copied with 600 permissions instead of 644. I have to change this permission every time I deploy the site making it not a friendly workflow to work on it.

Any help would be really appreciated. If more data is needed, I’m open to share it.

Thanks in advance!

First issue was actually “fixed” by coincidence last week: https://github.com/roots/sage/pull/1456

Second: Haven’t heard of anyone else having this issue, but you can try to modify the synchronize command we use and test out different settings. See the Ansible docs: http://docs.ansible.com/synchronize_module.html

archive is on by default so maybe turning that off and trying some other options might help. Look into the ones that deal with permissions.

Thanks again Scott!! Actually, this second issue was my fault! Files where locally with that 600 permissions but when I was checking on my vagrant box they appeared as 644. :rage: