From: Eric Morris Date: Tue, 29 Oct 2013 18:50:06 +0000 (-0700) Subject: Add downloads deploy process to Gruntfile X-Git-Tag: v1.0.0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9036d30e36f652707bf10628cf5b3f6a6e08dd2;p=thirdparty%2Ffoundation%2Ffoundation-emails.git Add downloads deploy process to Gruntfile --- diff --git a/Gruntfile.js b/Gruntfile.js index 310fae6d..2547f29f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,8 +3,8 @@ module.exports = function(grunt) { pkg: grunt.file.readJSON('package.json'), includes: { files: { - src: ['templates/base/*.html', 'templates/examples/*.html'], - dest: 'tmp', + src: 'templates/base/*.html', + dest: 'build/downloads/templates', flatten: true, cwd: '.', options: { @@ -12,10 +12,72 @@ module.exports = function(grunt) { includePath: 'css', } } + }, + shell: { + makeStage: { + command: [ + 'rm -rf build', + 'mkdir build', + 'mkdir build/downloads', + 'mkdir build/downloads/templates', + 'mkdir build/downloads/framework', + ].join('&&') + }, + zipTemplates: { + command: [ + 'cd build/downloads/templates', + 'zip all-templates.zip *.html', + 'for i in *.html; do zip "${i%}.zip" "$i"; done', + 'cd ../../../' + ].join('&&') + }, + zipFramework: { + command: [ + 'cp css/ink.css build/downloads/framework/ink.css', + 'cp templates/boilerplate.html build/downloads/framework/boilerplate.html', + // 'cp -r templates/examples build/downloads/framework/examples', + 'cd build/downloads/framework', + 'zip ink-<%= pkg.version %>.zip *', + 'cd ../../../', + + ].join('&&') + }, + linkFramework: { + command: [ + 'cd build/downloads', + 'echo \'.zip\" ?>\' > latest.php', + 'cd ../../', + ].join('&&') + }, + deployDownloads: { + command: [ + 'cd build/downloads', + 'rsync -r . ink@zurb.com:/var/www/ink/shared/downloads', + 'cd ../../' + ].join('&&') + }, + deployDocs: { + command: [ + 'cd tmp', + 'zip all.zip *.html', + 'for i in *.html; do zip "${i%}.zip" "$i"; done', + 'cd ../' + ].join('&&') + }, + cleanUp: { + command: [ + 'rm -rf build', + 'Say "Deploy Completed"' + ].join('&&') + } } }); grunt.loadNpmTasks('grunt-includes'); + grunt.loadNpmTasks('grunt-shell'); + - grunt.registerTask('default', ['includes']); + grunt.registerTask('make:templates', ['includes', 'shell:zipTemplates']); + grunt.registerTask('deploy:downloads', ['shell:makeStage', 'includes', 'shell:zipTemplates', 'shell:zipFramework', 'shell:linkFramework', 'shell:deployDownloads', 'shell:cleanUp']); + // grunt.registerTask('default', ['includes']); }; \ No newline at end of file diff --git a/package.json b/package.json index fa1c66ac..106b7dbe 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "grunt-cli": "~0.1.9" }, "devDependencies": { - "grunt-includes": "~0.3.5" + "grunt-includes": "~0.3.5", + "grunt-shell": "~0.5.0" }, "repository": { "type": "git",