You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/08/15 17:29:50 UTC

[1/2] git commit: Update coho README.md to include modern "getting started" instructions.

Updated Branches:
  refs/heads/master 9cf0fe8c7 -> d8070b69e


Update coho README.md to include modern "getting started" instructions.


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/d8070b69
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/d8070b69
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/d8070b69

Branch: refs/heads/master
Commit: d8070b69e5c0cf0fb5a6d77cc34262e929d13cc8
Parents: 68d22b2
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Aug 15 11:28:59 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Aug 15 11:29:36 2013 -0400

----------------------------------------------------------------------
 README.md | 42 ++++--------------------------------------
 1 file changed, 4 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/d8070b69/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 290de76..8540a9f 100644
--- a/README.md
+++ b/README.md
@@ -1,49 +1,15 @@
 COHO
 =======
 
-Coho is a script that automates the process for building releases of the Apache Cordova source code.
+Coho is a script that contains commands that make it easier to work with Cordova's many repositories.
 
 Prerequisites
 -------------
- - Must be run on a Mac with Lion (or later) installed
- - Have node installed (v 6.6+)
+ - Have node installed
  - Must have git setup
- - Install gpg
-	- Create a keypair if you don't have one already that can be used to 
-	sign the release artifact.
+ - Must install node dependencies via `npm install`
 
 Usage
 -----
-*	`./coho all 2.2.0 2.1.0`
+`./coho --help`
 
-	where 'all' is the commands to run, '2.2.0' is the current version to release,
-	and '2.1.0' is the previous version that will be diff'ed to
-	create a changelog using `git history`. Specifying the previous version
-	is optional, if you omit it a changelog will not be generated.
-	Running coho will do a `git checkout` of the tagged
-	specified release version (ie, '2.2.0'). Running coho will also create
-	the `temp/release/src` directory which is where the generated artifact
-	will be when coho completes.
-	
-	Other commands to run:
-	
-	`./coho build 2.2.0 2.1.0`
-	builds the release without zipping + signing.
-	
-	`./coho sign 2.2.0 2.1.0`
-	will take a built release and zip + sign it. Must run `build` before running `sign`. 
-	
-*	`make` OR `npm test`
-
-	runs `coho all 2.2.0 2.1.0` and the unit tests to verify the
-	packaging of the artifact. You may need to run `npm install` to 
-	install coffee-script and nodeunit if you wish to run this. You 
-	will probably want to change the release version 'VERSION' and the 
-	previous version 'OLDVER' variables at the top of the 
-	`test/tests.coffee` script from the default values of '2.2.0' and
-	'2.1.0' respectively.
-
-Issues
-------
-
-Please file all issues at <https://issues.apache.org/jira/browse/CB>.


[2/2] git commit: Use semver-friendly versions

Posted by ag...@apache.org.
Use semver-friendly versions


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/68d22b2b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/68d22b2b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/68d22b2b

Branch: refs/heads/master
Commit: 68d22b2b9854d78641778c925ead9b627d9a1512
Parents: 9cf0fe8
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Jul 16 19:12:07 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Aug 15 11:29:36 2013 -0400

----------------------------------------------------------------------
 coho | 39 ++++++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/68d22b2b/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index f493707..9938286 100755
--- a/coho
+++ b/coho
@@ -348,7 +348,15 @@ function fatal() {
 }
 
 function getVersionBranchName(version) {
-    return version.replace(/\d+(rc\d)?$/, 'x');
+    return version.replace(/\d+(-?rc\d)?$/, 'x');
+}
+
+function validateVersionString(version, opt_allowNonSemver) {
+    var pattern = opt_allowNonSemver ? /^\d+\.\d+\.\d+(-?rc\d)?$/ : /^\d+\.\d+\.\d+(-rc\d)?$/;
+    if (!pattern.test(version)) {
+        fatal('Versions must be in the form #.#.#-[rc#]');
+    }
+    return version;
 }
 
 function registerRepoFlag(opt) {
@@ -388,7 +396,7 @@ function execHelper(cmd, silent, allowError) {
         logCwd();
         print('Executing command:', cmd);
     }
-    var result = shjs.exec(cmd, {silent: silent});
+    var result = shjs.exec(cmd, {silent: (silent && silent !== 2)});
     if (result.code) {
         if (allowError) {
             return null;
@@ -451,7 +459,7 @@ function createReleaseCommand(argv) {
     var opt = registerRepoFlag(optimist)
     opt = opt
         .options('new-version', {
-            desc: 'The version to release. E.g. 2.7.1rc2',
+            desc: 'The version to release. E.g. 2.7.1-rc2',
             demand: true
          })
         .options('prev-version', {
@@ -487,8 +495,8 @@ function createReleaseCommand(argv) {
         process.exit(1);
     }
     var repos = computeReposFromFlag(argv.r);
-    var prevVersion = argv['prev-version'];
-    var newVersion = argv['new-version'];
+    var prevVersion = validateVersionString(argv['prev-version'], true);
+    var newVersion = validateVersionString(argv['new-version']);
 
     // Ensure we can find the path to the coho repo.
     var scriptPath = path.dirname(process.argv[1]);
@@ -989,7 +997,7 @@ function configureReleaseCommandFlags(opt) {
     var opt = registerRepoFlag(opt)
     opt = opt
         .options('version', {
-            desc: 'The version to use for the branch. Must match the pattern #.#.#[rc#]',
+            desc: 'The version to use for the branch. Must match the pattern #.#.#[-rc#]',
             demand: true
          });
     opt = registerHelpFlag(opt);
@@ -999,10 +1007,7 @@ function configureReleaseCommandFlags(opt) {
         optimist.showHelp();
         process.exit(1);
     }
-    var version = argv.version;
-    if (!/^\d+\.\d+\.\d+(rc\d)?$/.test(version)) {
-        fatal('The version must be in the form #.#.#[rc#]');
-    }
+    var version = validateVersionString(argv.version);
     return argv;
 }
 
@@ -1059,10 +1064,10 @@ function prepareReleaseBranchCommand() {
                'Command can also be used to update the JS snapshot after release \n' +
                'branches have been created.\n' +
                '\n' +
-               'Usage: $0 prepare-release-branch --version=2.8.0rc1')
+               'Usage: $0 prepare-release-branch --version=2.8.0-rc1')
     );
     var repos = computeReposFromFlag(argv.r);
-    var version = argv.version;
+    var version = validateVersionString(argv.version);
     var branchName = getVersionBranchName(version);
 
     // First - perform precondition checks.
@@ -1126,13 +1131,13 @@ function tagReleaseBranchCommand(argv) {
     var argv = configureReleaseCommandFlags(optimist
         .usage('Tags a release branches.\n' +
                '\n' +
-               'Usage: $0 tag-release --version=2.8.0rc1')
+               'Usage: $0 tag-release --version=2.8.0-rc1')
         .options('pretend', {
             desc: 'Don\'t actually run git commands, just print out what would be run.',
          })
     );
     var repos = computeReposFromFlag(argv.r);
-    var version = argv.version;
+    var version = validateVersionString(argv.version);
     var pretend = argv.pretend;
     var branchName = getVersionBranchName(version);
 
@@ -1381,13 +1386,14 @@ function createReleaseBugCommand() {
     });
     opt.usage('Creates an issue in JIRA for releasing a new version of Cordova, including creating all subtasks.\n' +
               '\n' +
-              'Usage: $0 create-release-bug --version=3.0.0rc1 --username=Alice --password=Passw0rd');
+              'Usage: $0 create-release-bug --version=3.0.0-rc1 --username=Alice --password=Passw0rd');
     var argv = opt.argv;
 
     if (argv.h) {
         optimist.showHelp();
         process.exit(1);
     }
+    var version = validateVersionString(argv.version);
 
     request.get(JIRA_API_URL + 'project/' + JIRA_PROJECT_KEY + '/components', function(err, res, components) {
         if (err) {
@@ -1408,7 +1414,6 @@ function createReleaseBugCommand() {
                 fatal('Error: JIRA returned no versions');
             }
             versions = JSON.parse(versions);
-            var version = argv.version;
             var root_version = version;
             var version_id = null;
             var prev_version = null;
@@ -1511,7 +1516,7 @@ function main() {
     // ShellJS opens a lot of file handles, and the default on OS X is too small.
     var ulimit = execHelper('ulimit -S -n', true, true);
     if (ulimit && ulimit < 2000) {
-        execHelper('/bin/bash -c \'ulimit -S -n 4096; exec "' + process.argv[0] + '" "' + process.argv.slice(1).join('" "') + '" --ulimit\'');
+        execHelper('/bin/bash -c \'ulimit -S -n 4096; exec "' + process.argv[0] + '" "' + process.argv.slice(1).join('" "') + '" --ulimit\'', 2);
         return;
     }