From 3b0d26bff1b965c789a8d3e0b605b0c46e073660 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Thu, 13 Oct 2016 20:56:43 -0500 Subject: [PATCH] better deploy --- .gitignore | 2 ++ Gruntfile.js | 30 ++++++++++++++++++++++++++++++ deploy.sh | 10 ---------- package.json | 2 ++ 4 files changed, 34 insertions(+), 10 deletions(-) delete mode 100755 deploy.sh diff --git a/.gitignore b/.gitignore index 6f82c67..5f5c527 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,5 @@ results *bower_components node_modules dist +.ftppass +sftpCache.json diff --git a/Gruntfile.js b/Gruntfile.js index 48bc4e1..8a9c818 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -69,7 +69,36 @@ module.exports = function(grunt) { hostname: '*', } } + }, + + copy: { + dist: { + expand: true, + cwd: '.', + src: [ + 'bower_components/normalize-css/normalize.css', + 'font/**/*', + 'img/**/*', + '*.{html,css}' + ], + dest: 'dist/' + } + }, + + 'sftp-deploy': { + build: { + auth: { + host: 'markamoser.com', + port: 6791, + authKey: 'workhorse' + }, + cache: 'sftpCache.json', + src: 'dist/', + dest: 'www/links/', + progress: true + } } + }); // Tasks @@ -83,4 +112,5 @@ module.exports = function(grunt) { }); grunt.registerTask('default', ['serve']); + grunt.registerTask('deploy', ['copy:dist', 'sftp-deploy:build']); }; diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 7d0eb9c..0000000 --- a/deploy.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -DEST=/var/www/links/ - -mkdir -p $DEST/bower_components/normalize-css -cp bower_components/normalize-css/normalize.css $DEST/bower_components/normalize-css/normalize.css - -cp -r ./font $DEST -cp -r ./img $DEST -cp ./*.html $DEST -cp ./*css $DEST diff --git a/package.json b/package.json index ddf46c2..e2761fc 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,11 @@ "devDependencies": { "grunt": "~0.4.5", "grunt-contrib-connect": "^0.11.2", + "grunt-contrib-copy": "^1.0.0", "grunt-contrib-csslint": "~0.5.0", "grunt-contrib-jshint": "~0.11.3", "grunt-contrib-watch": "0.6.1", + "grunt-sftp-deploy": "^0.2.5", "jshint-stylish": "~2.1.0", "load-grunt-tasks": "~3.3.0" },