Last active
August 29, 2015 14:11
-
-
Save drewlustro/b40c6af3f5506a47dbc7 to your computer and use it in GitHub Desktop.
Simple gulp-rsync deploy
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
server { | |
listen 80; | |
root /sites/SOME-SITE-ROOT-DIRECTORY/staging0; | |
index index.html index.htm; | |
server_name staging0.jessechorng.com; | |
location / { | |
try_files $uri $uri/ /index.html /index.htm; | |
} | |
location ~* .(jpg|jpeg|png|gif|ico|css|js|svg)$ { | |
expires 1m; | |
} | |
} |
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
var argv = require('yargs') | |
.options('d', { | |
alias: 'dest', | |
default: 'staging0' | |
}) | |
.usage('Usage: $0 -d <staging[0-3]|live>') | |
.argv; | |
gulp.task('deploy', ['build'], function() { | |
var dest = '/sites/SOME-SITE-ROOT-DIRECTOY/' + argv.d; | |
console.log('Deploy Destination: "' + dest + '"'); | |
return gulp.src('dist/**') | |
.pipe($.rsync({ | |
root: 'dist', | |
hostname: 'user@maxrelax.co', | |
destination: dest, | |
user: 'user', | |
incremental: true, | |
progress: true, | |
compress: true, | |
recursive: true | |
})); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Deploy to staging0
gulp deploy
Deploy to target (such as live)
gulp deploy -d live