From 71a61990090db25541f880ea98b6b0f07cf52fd4 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 4 Sep 2015 14:43:28 -0700 Subject: [PATCH 01/10] :arrow_up: text-buffer (prerelease) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5aecf66ce..08fc2dac8 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "space-pen": "3.8.2", "stacktrace-parser": "0.1.1", "temp": "0.8.1", - "text-buffer": "6.7.1", + "text-buffer": "6.7.2-0", "theorist": "^1.0.2", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", From 917e1eaa5111df805077e68c257c8d9a1e2e4556 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 4 Sep 2015 16:40:46 -0700 Subject: [PATCH 02/10] :arrow_up: text-buffer (prerelease) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 08fc2dac8..1824a0798 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "space-pen": "3.8.2", "stacktrace-parser": "0.1.1", "temp": "0.8.1", - "text-buffer": "6.7.2-0", + "text-buffer": "6.7.2-2", "theorist": "^1.0.2", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", From d048e6a94ee21256ad085f60bf8c1d2b87f9c0ec Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 4 Sep 2015 17:40:18 -0700 Subject: [PATCH 03/10] :arrow_up: text-buffer (prerelease) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1824a0798..0b18e8bfa 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "space-pen": "3.8.2", "stacktrace-parser": "0.1.1", "temp": "0.8.1", - "text-buffer": "6.7.2-2", + "text-buffer": "6.7.2-3", "theorist": "^1.0.2", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", From bd442dfa0c0856e8b2ccffa61fcf3d5fece0a039 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 8 Sep 2015 11:13:43 -0700 Subject: [PATCH 04/10] :arrow_up: text-buffer (prerelease) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0b18e8bfa..1adbe536d 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "space-pen": "3.8.2", "stacktrace-parser": "0.1.1", "temp": "0.8.1", - "text-buffer": "6.7.2-3", + "text-buffer": "6.7.2-4", "theorist": "^1.0.2", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", From 0143b133fedda386101ac070f7c4986b07f281c8 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 14 Sep 2015 16:54:27 -0700 Subject: [PATCH 05/10] Add railcar script --- script/railcar | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100755 script/railcar diff --git a/script/railcar b/script/railcar new file mode 100755 index 000000000..e97360fe4 --- /dev/null +++ b/script/railcar @@ -0,0 +1,102 @@ +#!/usr/bin/env node + +var fs = require('fs') +var exec = require('child_process').exec +var async = require('../build/node_modules/async') + +var branchName, leadingBranchName + +async.series([ + parseArguments, + checkCleanWorkingTree, + checkoutBranch, + pullUpstreamChanges, + mergeLeadingBranch, + fetchUpstreamTags, + updateVersionNumber, + pushLocalChanges, + pushLocalTags, +], finish) + +function parseArguments(next) { + branchName = process.argv[2] + switch (branchName) { + case 'beta': + leadingBranchName = 'master' + break + case 'stable': + leadingBranchName = 'beta' + break + default: + return next(new Error('Usage: script/railcar ')) + } + next() +} + +function checkCleanWorkingTree(next) { + console.log('Checking for a clean working tree'); + exec('git status --porcelain', function(error, output) { + var modifiedEntries = output.split('\n').filter(function(line) { + return !/^\?\?/.test(line) && line.length > 0 + }); + + next( + modifiedEntries.length === 0 ? + null : + new Error('Cannot run the railcars with a dirty working tree') + ) + }) +} + +function checkoutBranch(next) { + console.log('Checking out ' + branchName); + exec('git checkout ' + branchName, next) +} + +function pullUpstreamChanges(next) { + console.log('Pulling upstream changes on ' + branchName); + exec('git pull --ff-only origin ' + branchName, next) +} + +function mergeLeadingBranch(next) { + console.log('Merging new changes from ' + leadingBranchName); + exec('git pull --ff-only origin ' + leadingBranchName, next) +} + +function fetchUpstreamTags(next) { + console.log('Fetching upstream tags'); + exec('git fetch --tags', next) +} + +function updateVersionNumber(next) { + var newVersion + if (branchName === 'beta') { + newVersion = require('../package.json') + .version + .replace(/-\w+$/, '-beta-0') + } else { + newVersion = 'patch' + } + + console.log('Updating version to ' + newVersion); + exec('npm version ' + newVersion, next) +} + +function pushLocalChanges(next) { + console.log('Pushing local changes'); + exec('git push origin ' + branchName, next) +} + +function pushLocalTags(next) { + console.log('Pushing local tags'); + exec('git push --tags origin', next) +} + +function finish(error) { + if (error) { + console.log('Error: ' + error.message) + process.exit(1) + } + + console.log('Success! Now just wait for all CI builds to pass on ' + branchName) +} From 01a73e3ad3a2bd71cd1baf8091829c1fbabb9950 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 14 Sep 2015 17:34:41 -0700 Subject: [PATCH 06/10] Handle errors from 'git status' --- script/railcar | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/railcar b/script/railcar index e97360fe4..151c84154 100755 --- a/script/railcar +++ b/script/railcar @@ -36,6 +36,8 @@ function parseArguments(next) { function checkCleanWorkingTree(next) { console.log('Checking for a clean working tree'); exec('git status --porcelain', function(error, output) { + if (error) return next(error) + var modifiedEntries = output.split('\n').filter(function(line) { return !/^\?\?/.test(line) && line.length > 0 }); From 6bfa467a154f3c1e33b3bd11932da74e1e31aa70 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 14 Sep 2015 17:34:47 -0700 Subject: [PATCH 07/10] Remove unused require --- script/railcar | 1 - 1 file changed, 1 deletion(-) diff --git a/script/railcar b/script/railcar index 151c84154..2d98d2c68 100755 --- a/script/railcar +++ b/script/railcar @@ -1,6 +1,5 @@ #!/usr/bin/env node -var fs = require('fs') var exec = require('child_process').exec var async = require('../build/node_modules/async') From a9845e3d7f2646a734864470b565bca686bc4c8a Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 15 Sep 2015 10:45:02 -0700 Subject: [PATCH 08/10] Script stable and beta releases together --- script/railcar | 146 ++++++++++++++++++++++--------------------------- 1 file changed, 66 insertions(+), 80 deletions(-) diff --git a/script/railcar b/script/railcar index 2d98d2c68..fa3fca2cb 100755 --- a/script/railcar +++ b/script/railcar @@ -1,103 +1,89 @@ #!/usr/bin/env node +var fs = require('fs') var exec = require('child_process').exec -var async = require('../build/node_modules/async') +var series = require('async').series +var semver = require('semver') -var branchName, leadingBranchName - -async.series([ - parseArguments, +series([ + section('Preparing to roll the railcars'), checkCleanWorkingTree, - checkoutBranch, - pullUpstreamChanges, - mergeLeadingBranch, - fetchUpstreamTags, - updateVersionNumber, - pushLocalChanges, - pushLocalTags, + run('git fetch origin master:master beta:beta stable:stable'), + run('git fetch origin --tags'), + + section('Updating stable branch'), + run('git checkout stable'), + run('git merge --ff-only origin/stable'), + run('git merge --ff-only origin/beta'), + bumpStableVersion, + + section('Updating beta branch'), + run('git checkout beta'), + run('git merge --ff-only origin/beta'), + run('git merge --ff-only origin/master'), + run('git merge --strategy ours origin/stable'), + bumpBetaVersion, + + section('Updating master branch'), + run('git checkout master'), + run('git merge --ff-only origin/master'), + run('git merge --strategy ours origin/beta'), + bumpDevVersion, + + section('Pushing changes upstream'), + run('git push origin master:master beta:beta stable:stable'), + run('git push origin --tags') ], finish) -function parseArguments(next) { - branchName = process.argv[2] - switch (branchName) { - case 'beta': - leadingBranchName = 'master' - break - case 'stable': - leadingBranchName = 'beta' - break - default: - return next(new Error('Usage: script/railcar ')) - } - next() -} - -function checkCleanWorkingTree(next) { - console.log('Checking for a clean working tree'); - exec('git status --porcelain', function(error, output) { +function checkCleanWorkingTree (next) { + run('git status --porcelain')(function (error, output) { if (error) return next(error) - - var modifiedEntries = output.split('\n').filter(function(line) { - return !/^\?\?/.test(line) && line.length > 0 - }); - - next( - modifiedEntries.length === 0 ? - null : - new Error('Cannot run the railcars with a dirty working tree') - ) + if (output.trim().length > 0) return next(new Error('Cannot run the railcars with a dirty working tree')) + next() }) } -function checkoutBranch(next) { - console.log('Checking out ' + branchName); - exec('git checkout ' + branchName, next) +function bumpStableVersion (next) { + run('npm version patch')(next) } -function pullUpstreamChanges(next) { - console.log('Pulling upstream changes on ' + branchName); - exec('git pull --ff-only origin ' + branchName, next) +function bumpBetaVersion (next) { + var newVersion = semver.inc(getCurrentVersion(), 'prerelease', 'beta') + run('npm version ' + newVersion)(next) } -function mergeLeadingBranch(next) { - console.log('Merging new changes from ' + leadingBranchName); - exec('git pull --ff-only origin ' + leadingBranchName, next) +function bumpDevVersion (next) { + var newVersion = semver.inc(getCurrentVersion(), 'preminor', 'dev') + series([ + run('npm --no-git-tag-version version ' + newVersion), + run('git commit -am "' + newVersion + '"') + ], next) } -function fetchUpstreamTags(next) { - console.log('Fetching upstream tags'); - exec('git fetch --tags', next) -} - -function updateVersionNumber(next) { - var newVersion - if (branchName === 'beta') { - newVersion = require('../package.json') - .version - .replace(/-\w+$/, '-beta-0') - } else { - newVersion = 'patch' - } - - console.log('Updating version to ' + newVersion); - exec('npm version ' + newVersion, next) -} - -function pushLocalChanges(next) { - console.log('Pushing local changes'); - exec('git push origin ' + branchName, next) -} - -function pushLocalTags(next) { - console.log('Pushing local tags'); - exec('git push --tags origin', next) -} - -function finish(error) { +function finish (error) { if (error) { console.log('Error: ' + error.message) process.exit(1) } - console.log('Success! Now just wait for all CI builds to pass on ' + branchName) + console.log('OK, now just wait for all CI builds to pass on beta and stable') +} + +function getCurrentVersion () { + return JSON.parse(fs.readFileSync(require.resolve('../package.json'))).version +} + +function run (command) { + return function (next) { + console.log('>', command) + exec(command, next) + } +} + +function section (message) { + return function (next) { + console.log() + console.log(message) + next() + } } From 24263960ef9626174e0b10995464d25908ceca20 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 15 Sep 2015 14:33:11 -0700 Subject: [PATCH 09/10] :arrow_up: text-buffer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1adbe536d..4d6a67cd9 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "space-pen": "3.8.2", "stacktrace-parser": "0.1.1", "temp": "0.8.1", - "text-buffer": "6.7.2-4", + "text-buffer": "6.7.2", "theorist": "^1.0.2", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", From de61aecfd109b42ee27124b9c7cee2f2c03afd24 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Tue, 15 Sep 2015 19:03:47 -0400 Subject: [PATCH 10/10] :arrow_up: autocomplete-css@0.10.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c0ff47282..e1a71e098 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "about": "1.1.0", "archive-view": "0.60.0", "autocomplete-atom-api": "0.9.2", - "autocomplete-css": "0.10.1", + "autocomplete-css": "0.10.2", "autocomplete-html": "0.7.2", "autocomplete-plus": "2.19.0", "autocomplete-snippets": "1.7.1",