Merge branch 'master' into as-double-reflow-measurements

This commit is contained in:
Antonio Scandurra
2015-09-16 14:26:31 +02:00
2 changed files with 91 additions and 2 deletions

View File

@@ -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",
"theorist": "^1.0.2",
"typescript-simple": "1.0.0",
"underscore-plus": "^1.6.6",
@@ -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",

89
script/railcar Executable file
View File

@@ -0,0 +1,89 @@
#!/usr/bin/env node
var fs = require('fs')
var exec = require('child_process').exec
var series = require('async').series
var semver = require('semver')
series([
section('Preparing to roll the railcars'),
checkCleanWorkingTree,
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 checkCleanWorkingTree (next) {
run('git status --porcelain')(function (error, output) {
if (error) return next(error)
if (output.trim().length > 0) return next(new Error('Cannot run the railcars with a dirty working tree'))
next()
})
}
function bumpStableVersion (next) {
run('npm version patch')(next)
}
function bumpBetaVersion (next) {
var newVersion = semver.inc(getCurrentVersion(), 'prerelease', 'beta')
run('npm version ' + newVersion)(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 finish (error) {
if (error) {
console.log('Error: ' + error.message)
process.exit(1)
}
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()
}
}