Created
April 24, 2015 14:02
-
-
Save alfredbez/d9178ee844c9d67bd455 to your computer and use it in GitHub Desktop.
Deploy with git, rsync & gulp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### Are any Sass files canged or added? | |
if git status -s | grep '^M.\+s[ac]ss$' | |
then | |
gulp --cwd path/to/gulpfile css | |
fi | |
### Are any JS files canged or added? | |
if git status -s | grep '^M.\+js$' | |
then | |
gulp --cwd path/to/gulpfile js | |
fi | |
. ./path/to/upload.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
rsync \ | |
-chavzP \ | |
--stats \ | |
--exclude=node_modules \ | |
--exclude=upload.sh \ | |
--exclude=src \ | |
--exclude=package.json \ | |
--exclude=gulpfile.js \ | |
--exclude=bower.json \ | |
--exclude=config.json \ | |
--exclude=.csscomb.json \ | |
$DIR/ \ | |
ssh-host:/path/to/remote/dir/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment