Comments (16)
Another good find! I'll have a look. Thanks.
from middleman-deploy.
As an update I think it might be that rsync in not setting the permissions correctly. You need to send a CHMOD argument to rsync so that it specifically sets the file permissions to 644?
from middleman-deploy.
I'm looking into the FTP problem now, but I don't understand this rsync problem. I don't see that behavior. Perhaps you could submit a new issue with some more detail about the rsync problem? Thanks.
from middleman-deploy.
The problem doesn't seem to be due to size:
-rw-rw-r-- 1 tvaughan tvaughan 953 Apr 22 22:15 background.png
-rw-rw-r-- 1 tvaughan tvaughan 139 Apr 22 22:15 small.png
The problem seems to be with the PNG. Although I don't yet know why.
$ irb
irb(main):001:0> require "ptools"
=> true
irb(main):002:0> File.binary?("background.png")
=> false
irb(main):003:0> File.binary?("small.png")
=> true
I made small.png using:
convert background.png small.png
Still looking...
from middleman-deploy.
https://github.com/djberg96/ptools/blob/master/lib/ptools.rb#L90
There are too few characters outside of the range of 32 - 127 for this to be considered binary. Could you do what I did and convert the PNG?
As for a better long-term solution I'm not sure what to do. I could use the mimetype to check if the file is binary or not but that won't be completely accurate either. I could just always FTP in binary mode but that's sure to break in some way too. Ideas?
from middleman-deploy.
Thanks for a great add-on to Middleman!
I have this issue as well when deploying via FTP. Also – is there a way to only copy changed files over instead of all of them?
from middleman-deploy.
@asnoba Is your problem with a PNG? Can you convert the PNG like I did above? I'm not sure on the best long-term solution. It seems to me that each possible solution causes new problems. Thoughts?
RE: FTP should only upload changed files, see #37
from middleman-deploy.
Yes. And only with small PNG's as far as I can tell.
from middleman-deploy.
@asnoba Is the workaround I mentioned above an option for you? Any thoughts on a proper long-term solution? Thanks.
from middleman-deploy.
I'm sorry @tvaughan, but this issue is a bit too technical for me :)
from middleman-deploy.
Since this issue involves small image files being detected incorrectly as non-binary, you could use the FastImage ruby gem on each file being uploaded. It returns nil if it's not an image, or the type of image otherwise.
from middleman-deploy.
@tvaughan is @jtwalters suggestion good? Would love to use FTP as some instances of Middleman I'm using do not have their own SSH access for deployment via rsync. Thanks for all the hard work.
from middleman-deploy.
@tvaughan is @jtwalters suggestion good? Would love to use FTP as some instances of Middleman I'm using do not have their own SSH access for deployment via rsync. Thanks for all the hard work.
Looks good to me. If someone wants to submit a pull request, I'll
accept it. Thanks.
-Tom
from middleman-deploy.
I could just always FTP in binary mode but that's sure to break in some way too.
I don’t think it would be a problem to use binary transfer mode for all files. All the other methods (Git, SFTP, rsync) only support “binary” transfer anyway. So why should it cause problems for FTP?
from middleman-deploy.
Fixed by #57
from middleman-deploy.
Ace! Thanks @tvaughan @crtvhd :)
from middleman-deploy.
Related Issues (20)
- README: 'deploy_method' should be 'deploy' HOT 5
- Local changes would be overwritten by checkout
- CNAME gets blown out with force update HOT 4
- `block in initialize': undefined method `deploy_method=' for #<Middleman::Deploy
- Can't deploy to remote HOT 1
- Deploy build directory to github pages? HOT 7
- Git Force-Push Deploy Pushes Root Instead of Build Dir HOT 18
- undefined method "deploy_method" HOT 7
- Compatibility with Middleman 4.1.7 HOT 4
- Deploy path doesn't work for Git Deploy Method HOT 1
- Rsync: Configured username ignored HOT 4
- Forceful deploy cause long upload times
- deploy.user not being set HOT 1
- Error with Middleman 4.2 and middleman-deploy 1.0 HOT 16
- deploy.deploy_method has changed to method HOT 1
- How to deploy robots.txt file HOT 1
- Ubuntu 18.04 rsync method fails
- Support additional commands during deploy
- Feature Request: support a different trunk branch HOT 1
- Is this gem abandoned? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from middleman-deploy.