]> git.ipfire.org Git - thirdparty/foundation/foundation-emails.git/commitdiff
Add downloads deploy process to Gruntfile
authorEric Morris <eric@zurb.com>
Tue, 29 Oct 2013 18:50:06 +0000 (11:50 -0700)
committerEric Morris <eric@zurb.com>
Tue, 29 Oct 2013 18:50:06 +0000 (11:50 -0700)
Gruntfile.js
package.json

index 310fae6d3c3dfd091830a4c5fd849ea848363669..2547f29f9d12468b701eb61bd6a56065879185c9 100644 (file)
@@ -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 \'<?php $download_file = \"framework/ink-<%= pkg.version %>.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
index fa1c66ac5859137636658982adb3fa244baf6bd1..106b7dbed4f5c6494667ae88fac98d207d36c423 100644 (file)
@@ -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",