Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1393 from interactivellama/minor-major-uploads
Browse files Browse the repository at this point in the history
Upload to multiple folders on CDN
  • Loading branch information
Stephen Williams committed Jul 9, 2015
2 parents e6e7260 + 1a20139 commit ef27333
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,13 +633,19 @@ module.exports = function (grunt) {
},
uploadToCDN: {
command: function() {
var command = [
'mv dist ' + '<%= pkg.version %>',
'scp -i ~/.ssh/fuelcdn -r "' + '<%= pkg.version %>' + '"/ ' +

function createUploadCommand(version) {
return ['mv dist ' + version,
'scp -i ~/.ssh/fuelcdn -r "' + version + '"/ ' +
'<%= cdnLoginFile.user %>' + '@' + '<%= cdnLoginFile.server %>' + ':' + '<%= cdnLoginFile.folder %>',
'mv "' + '<%= pkg.version %>' + '" dist',
'echo "Done uploading files."'
].join(' && ');
'mv "' + version + '" dist',
'echo "Done uploading files."'].join(' && ');
}
var command = [
packageVersion,
semver.major(packageVersion) + '.' + semver.minor(packageVersion),
semver.major(packageVersion)
].map(createUploadCommand).join(' && ');
grunt.log.write('Uploading: ' + command);
grunt.log.writeln('');
return command;
Expand Down Expand Up @@ -820,6 +826,10 @@ module.exports = function (grunt) {
------------- */
grunt.registerTask('notes', 'Run a ruby gem that will request from Github unreleased pull requests', ['shell:notes']);

grunt.registerTask('updateRelease', '', function () {
packageVersion = require('./package.json').version;
});

// Maintainers: Run prior to a release. Includes SauceLabs VM tests.
grunt.registerTask('release', 'Release a new version, push it and publish it', function() {
if ( typeof grunt.config('sauceLoginFile') === 'undefined' ) {
Expand All @@ -832,17 +842,14 @@ module.exports = function (grunt) {
' Please contact another maintainer to obtain this file.');
}

grunt.task.run(['prompt:tempbranch','dorelease']);
});
// update local variable to make sure build prompt is using temp branch's package version
grunt.task.run(['prompt:tempbranch', 'shell:checkoutRemoteReleaseBranch',
'updateRelease', 'prompt:build', 'dorelease']);
});

// formerally dorelease task
// formerally dorelease task
grunt.registerTask('dorelease', '', function () {

grunt.task.run(['shell:checkoutRemoteReleaseBranch']);
//update local variable to make sure build prompt is using temp branch's package version
packageVersion = require('./package.json').version;
grunt.task.run(['prompt:build']);

grunt.log.writeln('');

if (!grunt.option('no-tests')) {
Expand Down

0 comments on commit ef27333

Please sign in to comment.