Skip to content

Instantly share code, notes, and snippets.

@jdorrance
Last active December 19, 2015 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdorrance/5904145 to your computer and use it in GitHub Desktop.
Save jdorrance/5904145 to your computer and use it in GitHub Desktop.
files="$(find . -not -path "*/build/*" -not -path "*/node_modules/*" -regex '.*\.\(js\|css\|png\|jpg|\jpeg|\gif|\|mov|\)' -type f)"
echo "Count: $(echo -n "$files" | wc -l)"
echo "$files" | while read file; do
echo "Gzipping - $file"
gzip < $file > $file.gz
rm $file -f
cp $file.gz $file
rm $file.gz -f
done
s3cmd sync --recursive --delete-removed --cf-invalidate —guess-mime-type --add-header "Cache-Control: max-age=604800, public" --add-header "Content-Encoding: gzip" --exclude 'node_modules/**/*' --exclude '.git/**/*' --exclude 'build/**/*' --rexclude '.+?\.(?!css|.+\.js|js|.+\.css|css|jpeg|gif|mov|png|jpg).+' ./ s3://mavendc-testgc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment