- improved the README documentation - cleaned up some whitespaces in the coho script and output a message describing where the generated artifact is located. - added missing platform arg when invoking coho from tests.coffee script - commented out bin tests since coho does not generate bin content - fixed broken tests. They all pass now. - change from deprecated path.existsSync to fs.existsSync
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/commit/6540ff3d Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/tree/6540ff3d Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/diff/6540ff3d Branch: refs/heads/master Commit: 6540ff3d9edee3e820e95b94fb89d49417390ccd Parents: a22dbed Author: Marcel Kinard <[email protected]> Authored: Wed Oct 24 11:04:29 2012 -0400 Committer: Marcel Kinard <[email protected]> Committed: Wed Oct 24 11:04:29 2012 -0400 ---------------------------------------------------------------------- README.md | 52 ++++++--- coho | 23 ++-- test/tests.coffee | 277 ++++++++++++++++++++++++++++-------------------- 3 files changed, 208 insertions(+), 144 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/6540ff3d/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index ca86f84..5a2f101 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,68 @@ COHO ======= -Coho is a script that automates the release process for building Apache Cordova releases. +Coho is a script that automates the process for building releases of the Apache Cordova source code. Prerequisites ------------- - - Must be run on a Mac with Lion installed + - Must be run on a Mac with Lion (or later) installed - Have node installed (v 6.6+) - - Must have git setup + - Must have git setup - Install joDoc - - Have perl 5.8+ + - Have perl 5.8+ installed - Clone [joDoc](http://github.com/davebalmer/jodoc) git clone http://github.com/davebalmer/joDoc.git - - Add joDoc/ to your path + - Add `joDoc/` to your path: - Open `~/.bashrc` or `~/.profile` (or whatever you use) + Open `~/.bashrc` or `~/.profile` (or whatever you use) and export PATH=$PATH:~/path/to/joDoc/ - - Install markdown + - Install markdown: - # Use your package manager + # Use your package manager such as: brew install markdown port install markdown aptitude install markdown - - Install nokogiri (Ruby HTML parser) + - Install nokogiri (Ruby HTML parser): gem install nokogiri - - Install json (Ruby JSON parser) + - Install json (Ruby JSON parser): gem install json -- Install android -- Install gpg + - Install Android SDK + - Install gpg + + - Create a keypair if you don't have one already that can be used to + sign the release artifact. Usage ----- - coho all 1.8.0 1.7.0 - // creates temp/release directory which contains bin folder, changelog, doc folder, KEYS, and src folder. - - make - // runs coho 1.8.0 1.3.0 and the unit tests +* `./coho all 1.8.0 1.7.0` + + where 'all' is the platforms to include, '1.8.0' is the current version + to release, and '1.7.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, '1.8.0'). Running coho will also create + the `temp/release/src` directory which is where the generated artifact + will be when coho completes. +* `make` + + runs `coho all 1.8.0 1.7.0` and the unit tests to verify the + packaging of the artifact. You may need to + npm 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 'oldVersion' variables at the top of the + `test/tests.coffee` script from the default values of '1.8.0' and + '1.7.0' respectively. Issues ------ -Please file all issues at https://issues.apache.org/jira/browse/CB \ No newline at end of file +Please file all issues at <https://issues.apache.org/jira/browse/CB>. http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/6540ff3d/coho ---------------------------------------------------------------------- diff --git a/coho b/coho index c527c34..0714624 100755 --- a/coho +++ b/coho @@ -25,14 +25,14 @@ if (!PLATFORM) { VERSION = process.argv[3] var util = require('util') , exec = require('child_process').exec -, fs = require('fs') +, fs = require('fs') , ios = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-ios.git' , blackberry = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks.git' , android = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-android.git' , windows = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-wp7.git' , webos = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-webos.git' , bada = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-bada.git' -, badaWac = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac.git' +, badaWac = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-bada-wac.git' , docs = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-docs.git' , cordovajs = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-js.git' , tizen = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-tizen.git' @@ -40,13 +40,13 @@ var util = require('util') , mac = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-mac.git' , mobilespec = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-mobile-spec.git' , helloworld = 'https://git-wip-us.apache.org/repos/asf/incubator-cordova-app-hello-world.git' -, iosdir = 'incubator-cordova-ios' -, blackberrydir = 'incubator-cordova-blackberry-webworks' -, androiddir = 'incubator-cordova-android' -, windowsdir = 'incubator-cordova-wp7' -, webosdir = 'incubator-cordova-webos' -, badadir = 'incubator-cordova-bada' -, badaWacdir = 'incubator-cordova-bada-wac' +, iosdir = 'incubator-cordova-ios' +, blackberrydir = 'incubator-cordova-blackberry-webworks' +, androiddir = 'incubator-cordova-android' +, windowsdir = 'incubator-cordova-wp7' +, webosdir = 'incubator-cordova-webos' +, badadir = 'incubator-cordova-bada' +, badaWacdir = 'incubator-cordova-bada-wac' , docsdir = 'incubator-cordova-docs' , cordovajsdir = 'incubator-cordova-js' , tizendir = 'incubator-cordova-tizen' @@ -55,8 +55,8 @@ var util = require('util') , mobilespecdir = 'incubator-cordova-mobile-spec' , helloworlddir = 'incubator-cordova-app-hello-world' , tempRepoDir = 'temp/repositories' -, releaseSrcDir = '../../release/src/cordova-'+VERSION -, oldVer = process.argv[4]; +, releaseSrcDir = '../../release/src/cordova-'+VERSION +, oldVer = process.argv[4]; var commandQueue = [], child; @@ -253,6 +253,7 @@ queueCommand("cd temp/ && find `pwd` -name .DS_Store | xargs rm -r"); queueCommand("echo 'Zipping and signing src'"); queueCommand("cd temp/release/src && zip -rq "+ cordovaSrcZip +" * && gpg --armor --output "+cordovaSrcAsc+" --detach-sig "+cordovaSrcZip+" && gpg --print-md MD5 "+cordovaSrcZip+" > " + cordovaSrcMd5 +" && gpg --print-md SHA512 " + cordovaSrcZip + " > " + cordovaSrcSha); +queueCommand("echo Created temp/release/src/"+cordovaSrcZip+" with corresponding asc, md5, and sha files."); /* clean up queueCommand("echo 'Final clean up'"); http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/6540ff3d/test/tests.coffee ---------------------------------------------------------------------- diff --git a/test/tests.coffee b/test/tests.coffee index 20af22a..f4b34a8 100644 --- a/test/tests.coffee +++ b/test/tests.coffee @@ -1,5 +1,5 @@ -VERSION = '1.9.0rc1' -oldVersion = '1.8.1' +VERSION = '1.8.0' +oldVersion = '1.7.0' exports['sanity test'] = (test)-> test.expect 1 @@ -12,95 +12,115 @@ exports['test cli callable'] = (test)-> thetest = (error, stdout, stderr)-> if error isnt null - test.ok false, 'coho fucked up' + test.ok false, 'coho invocation returned an error' test.done() else test.ok true, 'successfully called coho' test.done() - child = exec "./coho #{VERSION} #{oldVersion}", thetest + child = exec "./coho all #{VERSION} #{oldVersion}", thetest exports['creating temp directory'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp") + fs = require('fs') + test.ok fs.existsSync("./temp") test.done() exports['creating release directory']=(test)-> test.expect 1 - test.ok require('path').existsSync("./temp/release") + fs = require('fs') + test.ok fs.existsSync("./temp/release") test.done() -exports['creating bin directory']=(test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/release/bin") - test.done() +# commented out because coho does not generate binary content +# exports['creating bin directory']=(test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/release/bin") +# test.done() -exports['confirm bin zip file']=(test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip") - test.done() - -exports['confirm bin asc file']=(test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip.asc") - test.done() +# commented out because coho does not generate binary content +# exports['confirm bin zip file']=(test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip") +# test.done() + +# commented out because coho does not generate binary content +# exports['confirm bin asc file']=(test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip.asc") +# test.done() -exports['confirm bin md5 file']=(test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip.md5") - test.done() +# commented out because coho does not generate binary content +# exports['confirm bin md5 file']=(test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip.md5") +# test.done() -exports['test if bin zip is empty'] = (test)-> - test.expect 1 - fs = require('fs') - test.ok fs.statSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip").size != 0, 'bin zip created too soon' - test.done() - -exports['test if bin asc is empty'] = (test)-> - test.expect 1 - fs = require('fs') - test.ok fs.statSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip.asc").size != 0, 'bin asc created too soon' - test.done() - -exports['test if bin md5 is empty'] = (test)-> - test.expect 1 - fs = require('fs') - test.ok fs.statSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip.md5").size != 0, 'bin md5 created too soon' - test.done() +# commented out because coho does not generate binary content +# exports['test if bin zip is empty'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.statSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip").size != 0, 'bin zip created too soon' +# test.done() + +# commented out because coho does not generate binary content +# exports['test if bin asc is empty'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.statSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip.asc").size != 0, 'bin asc created too soon' +# test.done() + +# commented out because coho does not generate binary content +# exports['test if bin md5 is empty'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.statSync("./temp/release/bin/cordova-"+VERSION+"-incubating-bin.zip.md5").size != 0, 'bin md5 created too soon' +# test.done() exports['confirm ios clone worked'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-ios/CordovaLib/VERSION") + fs = require('fs') + test.ok fs.existsSync("./temp/repositories/incubator-cordova-ios/CordovaLib/VERSION") test.done() exports['confirm android clone worked'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-android/VERSION") + fs = require('fs') + test.ok fs.existsSync("./temp/repositories/incubator-cordova-android/VERSION") test.done() exports['confirm blackberry clone worked'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-blackberry-webworks/VERSION") + fs = require('fs') + test.ok fs.existsSync("./temp/repositories/incubator-cordova-blackberry-webworks/VERSION") test.done() exports['confirm windows clone worked'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-wp7/VERSION") + fs = require('fs') + test.ok fs.existsSync("./temp/repositories/incubator-cordova-wp7/VERSION") test.done() exports['confirm webos clone worked'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-webos/VERSION") + fs = require('fs') + test.ok fs.existsSync("./temp/repositories/incubator-cordova-webos/VERSION") test.done() exports['confirm bada clone worked'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-bada/VERSION") + fs = require('fs') + test.ok fs.existsSync("./temp/repositories/incubator-cordova-bada/VERSION") test.done() exports['confirm docs clone worked'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-docs/VERSION") + fs = require('fs') + test.ok fs.existsSync("./temp/repositories/incubator-cordova-docs/VERSION") test.done() exports['check ios version number'] = (test)-> @@ -136,7 +156,7 @@ exports['check blackberry version number'] = (test)-> exports['check windows version number'] = (test)-> test.expect 1 fs = require('fs') - if fs.readFileSync('./temp/repositories/incubator-cordova-wp7/VERSION', 'ascii') != VERSION + if fs.readFileSync('./temp/repositories/incubator-cordova-wp7/VERSION', 'ascii') != VERSION+"\n" test.ok false, "VERSION file doesn't match release version" test.done() else @@ -156,7 +176,7 @@ exports['check webos version number'] = (test)-> exports['check bada version number'] = (test)-> test.expect 1 fs = require('fs') - if fs.readFileSync('./temp/repositories/incubator-cordova-bada/VERSION', 'ascii') != VERSION+"\n\n" + if fs.readFileSync('./temp/repositories/incubator-cordova-bada/VERSION', 'ascii') != VERSION+"\n" test.ok false, "VERSION file doesn't match release version" test.done() else @@ -166,104 +186,131 @@ exports['check bada version number'] = (test)-> exports['check docs version number'] = (test)-> test.expect 1 fs = require('fs') - if fs.readFileSync('./temp/repositories/incubator-cordova-docs/VERSION', 'ascii') != VERSION+"\n" + if fs.readFileSync('./temp/repositories/incubator-cordova-docs/VERSION', 'ascii') != VERSION test.ok false, "VERSION file doesn't match release version" test.done() else test.ok true, "VERSION file matches release version" test.done() -exports['docs script successfull'] = (test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-docs/public") - test.done() - -exports['docs copied into release'] = (test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/release/doc") - test.done() - -exports['confirm doc zip file']=(test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip") - test.done() - -exports['confirm doc asc file']=(test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip") - test.done() - -exports['confirm doc md5 file']=(test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip") - test.done() - -exports['test if doc zip is empty'] = (test)-> - test.expect 1 - fs = require('fs') - test.ok fs.statSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip").size != 0, 'doc zip created too soon' - test.done() - -exports['test if doc asc is empty'] = (test)-> - test.expect 1 - fs = require('fs') - test.ok fs.statSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip.asc").size != 0, 'doc asc created too soon' - test.done() - -exports['test if doc md5 is empty'] = (test)-> - test.expect 1 - fs = require('fs') - test.ok fs.statSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip.md5").size != 0, 'doc md5 created too soon' - test.done() +# commented out because coho does not generate binary content +# exports['docs script successfull'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/repositories/incubator-cordova-docs/public") +# test.done() + +# commented out because coho does not generate binary content +# exports['docs copied into release'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/release/doc") +# test.done() + +# commented out because coho does not generate binary content +# exports['confirm doc zip file']=(test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip") +# test.done() + +# commented out because coho does not generate binary content +# exports['confirm doc asc file']=(test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip.asc") +# test.done() + +# commented out because coho does not generate binary content +# exports['confirm doc md5 file']=(test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip.md5") +# test.done() + +# commented out because coho does not generate binary content +# exports['test if doc zip is empty'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.statSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip").size != 0, 'doc zip created too soon' +# test.done() + +# commented out because coho does not generate binary content +# exports['test if doc asc is empty'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.statSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip.asc").size != 0, 'doc asc created too soon' +# test.done() + +# commented out because coho does not generate binary content +# exports['test if doc md5 is empty'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.statSync("./temp/release/doc/cordova-"+VERSION+"-incubating-doc.zip.md5").size != 0, 'doc md5 created too soon' +# test.done() -exports['ios script successfull'] = (test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-ios/dist/Cordova-"+VERSION+".dmg") - test.done() +# commented out because coho does not generate binary content +# exports['ios script successfull'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/repositories/incubator-cordova-ios/dist/Cordova-"+VERSION+".dmg") +# test.done() -exports['android script successfull'] = (test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-android/example/libs/cordova-"+VERSION+".jar") - test.done() - -exports['blackberry script successfull'] = (test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/repositories/incubator-cordova-blackberry-webworks/dist/www/cordova-"+VERSION+".js") - test.done() +# commented out because coho does not generate binary content +# exports['android script successfull'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/repositories/incubator-cordova-android/example/libs/cordova-"+VERSION+".jar") +# test.done() + +# commented out because coho does not generate binary content +# exports['blackberry script successfull'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/repositories/incubator-cordova-blackberry-webworks/dist/www/cordova-"+VERSION+".js") +# test.done() exports['license copied into release'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp/release/license") + fs = require('fs') + test.ok fs.existsSync("./temp/release/src/cordova-"+VERSION+"/LICENSE") test.done() -exports['version file copied into release'] = (test)-> - test.expect 1 - test.ok require('path').existsSync("./temp/release/version") - test.done() +# commented out because each component has a version, and the version number is in the dir name +# exports['version file copied into release'] = (test)-> +# test.expect 1 +# fs = require('fs') +# test.ok fs.existsSync("./temp/release/version") +# test.done() exports['readme copied into release'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp/release/readme.md") + fs = require('fs') + test.ok fs.existsSync("./temp/release/src/cordova-"+VERSION+"/README.MD") test.done() exports['test if changelog generated'] = (test)-> test.expect 1 - test.ok require('path').existsSync("./temp/release/changelog") + fs = require('fs') + test.ok fs.existsSync("./temp/release/src/cordova-"+VERSION+"/changelog") test.done() exports['confirm src zip file']=(test)-> test.expect 1 - test.ok require('path').existsSync("./temp/release/src/cordova-"+VERSION+"-incubating-src.zip") + fs = require('fs') + test.ok fs.existsSync("./temp/release/src/cordova-"+VERSION+"-incubating-src.zip") test.done() exports['confirm src asc file']=(test)-> test.expect 1 - test.ok require('path').existsSync("./temp/release/src/cordova-"+VERSION+"-incubating-src.zip") + fs = require('fs') + test.ok fs.existsSync("./temp/release/src/cordova-"+VERSION+"-incubating-src.zip.asc") test.done() exports['confirm src md5 file']=(test)-> test.expect 1 - test.ok require('path').existsSync("./temp/release/src/cordova-"+VERSION+"-incubating-src.zip") + fs = require('fs') + test.ok fs.existsSync("./temp/release/src/cordova-"+VERSION+"-incubating-src.zip.md5") test.done() exports['test if src zip is empty'] = (test)->
