0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

closes #103 - deployments

Added a standard grunt build task for doing deploys, this works in tandem with the ghost-deploy.sh script
Switched grunt-zip for grunt-contrib-compress as it seems more stable/reliable
This commit is contained in:
Hannah Wolfe 2013-06-18 22:25:32 +01:00
parent ce6ea8cd66
commit f5e46449ef
2 changed files with 46 additions and 7 deletions

View file

@ -12,8 +12,10 @@
adminAssets: './core/admin/assets', adminAssets: './core/admin/assets',
build: buildDirectory, build: buildDirectory,
nightlyBuild: path.join(buildDirectory, 'nightly'), nightlyBuild: path.join(buildDirectory, 'nightly'),
buildBuild: path.join(buildDirectory, 'build'),
dist: distDirectory, dist: distDirectory,
nightlyDist: path.join(distDirectory, 'nightly') nightlyDist: path.join(distDirectory, 'nightly'),
buildDist: path.join(distDirectory, 'build')
}, },
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),
@ -127,14 +129,42 @@
], ],
dest: "<%= paths.nightlyBuild %>/<%= pkg.version %>/" dest: "<%= paths.nightlyBuild %>/<%= pkg.version %>/"
}] }]
},
build: {
files: [{
expand: true,
src: [
'**',
'!node_modules/**',
'!core/shared/data/*.db',
'!.sass*',
'!.af*',
'!.git*',
'!.groc*',
'!.travis.yml'
],
dest: "<%= paths.buildBuild %>/"
}]
} }
}, },
zip: {
compress: {
nightly: { nightly: {
options: {
archive: "<%= paths.nightlyDist %>/Ghost-Nightly-<%= pkg.version %>.zip"
},
expand: true,
cwd: "<%= paths.nightlyBuild %>/<%= pkg.version %>/", cwd: "<%= paths.nightlyBuild %>/<%= pkg.version %>/",
src: ["<%= paths.nightlyBuild %>/<%= pkg.version %>/**"], src: ["**"]
dest: "<%= paths.nightlyDist %>/Ghost-Nightly-<%= pkg.version %>.zip" },
build: {
options: {
archive: "<%= paths.buildDist %>/Ghost-Build.zip"
},
expand: true,
cwd: "<%= paths.buildBuild %>/",
src: ["**"]
} }
} }
}; };
@ -145,8 +175,8 @@
grunt.loadNpmTasks("grunt-mocha-test"); grunt.loadNpmTasks("grunt-mocha-test");
grunt.loadNpmTasks("grunt-shell"); grunt.loadNpmTasks("grunt-shell");
grunt.loadNpmTasks("grunt-bump"); grunt.loadNpmTasks("grunt-bump");
grunt.loadNpmTasks("grunt-zip");
grunt.loadNpmTasks("grunt-contrib-compress");
grunt.loadNpmTasks("grunt-contrib-copy"); grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-watch"); grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-sass"); grunt.loadNpmTasks("grunt-contrib-sass");
@ -182,13 +212,14 @@
* - TODO: POST to pubsubhubub to notify of new build? * - TODO: POST to pubsubhubub to notify of new build?
*/ */
grunt.registerTask("nightly", [ grunt.registerTask("nightly", [
"shell:bourbon",
"sass:admin", "sass:admin",
"handlebars", "handlebars",
"validate", "validate",
"bump", "bump",
"updateCurrentPackageInfo", "updateCurrentPackageInfo",
"copy:nightly", "copy:nightly",
"zip:nightly" "compress:nightly"
/* Caution: shit gets real below here */ /* Caution: shit gets real below here */
//"shell:commitNightly", //"shell:commitNightly",
//"shell:tagNightly", //"shell:tagNightly",
@ -196,6 +227,14 @@
//"shell:pushMasterTags" //"shell:pushMasterTags"
]); ]);
grunt.registerTask("build", [
"shell:bourbon",
"sass:admin",
"handlebars",
"copy:build",
"compress:build"
]);
// When you just say "grunt" // When you just say "grunt"
grunt.registerTask("default", ['sass:admin', 'handlebars']); grunt.registerTask("default", ['sass:admin', 'handlebars']);
}; };

View file

@ -34,8 +34,8 @@
"grunt-contrib-handlebars": "~0.5.9", "grunt-contrib-handlebars": "~0.5.9",
"grunt-contrib-watch": "~0.4.4", "grunt-contrib-watch": "~0.4.4",
"grunt-bump": "0.0.2", "grunt-bump": "0.0.2",
"grunt-zip": "~0.9.0",
"grunt-contrib-copy": "~0.4.1", "grunt-contrib-copy": "~0.4.1",
"grunt-contrib-compress": "~0.5.2",
"mocha-as-promised": "~1.4.0" "mocha-as-promised": "~1.4.0"
} }
} }