From e24539e914cb6b0a5021ee8611a4d56939490005 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Thu, 24 Jan 2013 18:12:02 +1100 Subject: [PATCH 01/18] making it into a clickstart --- clickstart.json | 25 ++++++++++ jenkins.xml | 118 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 clickstart.json create mode 100644 jenkins.xml diff --git a/clickstart.json b/clickstart.json new file mode 100644 index 0000000000..7a6d29c93b --- /dev/null +++ b/clickstart.json @@ -0,0 +1,25 @@ +{ + "id": "angularjs-clickstart", + "name": "Angular js goodness", + "source": "github", + "description" : "test and deploy an angular js app", + "icon" : "https://d3ko533tu1ozfq.cloudfront.net/clickstart/nodejs_large.png", + + "supported-by" : "community", + "order" : 10, + + "runtime": { + "type": "nodejs", + "app-parameters" : { + "runtime.PLUGIN.SRC.nodejs": "https://s3.amazonaws.com/cloudbees-downloads/clickstack/node-clickstack.zip" + } + }, + + "build-with-jenkins": { + "template": { + "type": "https://raw.github.com/michaelneale/angular-seed/master/jenkins.xml", + "options": { + } + } + } +} diff --git a/jenkins.xml b/jenkins.xml new file mode 100644 index 0000000000..4a27a0282b --- /dev/null +++ b/jenkins.xml @@ -0,0 +1,118 @@ + + + + Build and test the node.js app + + 60 + -1 + -1 + 20 + + false + + + + + + + false + + (jenkins) + ${account} + + + + + + 2 + + + + + ${repositoryUrl} + + + + + ** + + + false + false + false + false + false + false + false + false + false + false + + Default + + + + + + + + false + + + + true + false + false + false + (Default) + + + + + + false + + + +node_version=v0.8.14 + +file_name=node-$node_version-linux-x64 + +if [ ! -e $file_name ] +then + wget http://nodejs.org/dist/$node_version/$file_name.tar.gz + tar xf $file_name.tar.gz +fi +rm -rf target +mkdir target + +node_dir=$PWD/$file_name + +cd app +$node_dir/bin/npm install +$node_dir/bin/npm test + +rm -rf ../target/app.zip +zip -r ../target/app.zip * + + + + + + (jenkins) + ${account} + + + ${applicationName} + + + https://api.cloudbees.com/api + target/*.zip + + + + + + + + \ No newline at end of file From e2f3e0b507b75b46ec67605cd731ce1889aade66 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Thu, 24 Jan 2013 18:19:37 +1100 Subject: [PATCH 02/18] testing stuff --- jenkins.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/jenkins.xml b/jenkins.xml index 4a27a0282b..1e34ff6dcc 100644 --- a/jenkins.xml +++ b/jenkins.xml @@ -74,6 +74,11 @@ + +#enable x11 +export DISPLAY=:1 +Xvfb :1 & + node_version=v0.8.14 file_name=node-$node_version-linux-x64 @@ -88,12 +93,8 @@ mkdir target node_dir=$PWD/$file_name -cd app -$node_dir/bin/npm install -$node_dir/bin/npm test - -rm -rf ../target/app.zip -zip -r ../target/app.zip * +$node_dir/bin/npm install -g testacular +scripts/test.sh From 1db67165f4b738e35eb21a84bd302eacbdf68970 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Thu, 24 Jan 2013 18:24:04 +1100 Subject: [PATCH 03/18] try again --- jenkins.xml | 13 +++-- jenkins_busted.xml | 119 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 7 deletions(-) create mode 100644 jenkins_busted.xml diff --git a/jenkins.xml b/jenkins.xml index 1e34ff6dcc..4a27a0282b 100644 --- a/jenkins.xml +++ b/jenkins.xml @@ -74,11 +74,6 @@ - -#enable x11 -export DISPLAY=:1 -Xvfb :1 & - node_version=v0.8.14 file_name=node-$node_version-linux-x64 @@ -93,8 +88,12 @@ mkdir target node_dir=$PWD/$file_name -$node_dir/bin/npm install -g testacular -scripts/test.sh +cd app +$node_dir/bin/npm install +$node_dir/bin/npm test + +rm -rf ../target/app.zip +zip -r ../target/app.zip * diff --git a/jenkins_busted.xml b/jenkins_busted.xml new file mode 100644 index 0000000000..1e34ff6dcc --- /dev/null +++ b/jenkins_busted.xml @@ -0,0 +1,119 @@ + + + + Build and test the node.js app + + 60 + -1 + -1 + 20 + + false + + + + + + + false + + (jenkins) + ${account} + + + + + + 2 + + + + + ${repositoryUrl} + + + + + ** + + + false + false + false + false + false + false + false + false + false + false + + Default + + + + + + + + false + + + + true + false + false + false + (Default) + + + + + + false + + + + +#enable x11 +export DISPLAY=:1 +Xvfb :1 & + +node_version=v0.8.14 + +file_name=node-$node_version-linux-x64 + +if [ ! -e $file_name ] +then + wget http://nodejs.org/dist/$node_version/$file_name.tar.gz + tar xf $file_name.tar.gz +fi +rm -rf target +mkdir target + +node_dir=$PWD/$file_name + +$node_dir/bin/npm install -g testacular +scripts/test.sh + + + + + + (jenkins) + ${account} + + + ${applicationName} + + + https://api.cloudbees.com/api + target/*.zip + + + + + + + + \ No newline at end of file From 204f06825d9fcd305a3da6af50c394d7a31ab8e7 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Thu, 24 Jan 2013 19:34:43 +1100 Subject: [PATCH 04/18] single run --- config/testacular.conf.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/testacular.conf.js b/config/testacular.conf.js index ad0ade4777..58b08c976b 100644 --- a/config/testacular.conf.js +++ b/config/testacular.conf.js @@ -14,7 +14,15 @@ autoWatch = true; browsers = ['Chrome']; +singleRun = true; +reporters = ['dots', 'junit']; +junitReporter = { + outputFile: 'test-results.xml' +}; + +/* junitReporter = { outputFile: 'test_out/unit.xml', suite: 'unit' }; +*/ From abf465f7cd5b106ddaaae03677eb355551f285f9 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Thu, 24 Jan 2013 21:43:24 +1100 Subject: [PATCH 05/18] corrected build and test conf --- config/testacular.conf.js | 12 ++-- jenkins.xml | 25 ++++---- jenkins_busted.xml | 119 -------------------------------------- 3 files changed, 17 insertions(+), 139 deletions(-) delete mode 100644 jenkins_busted.xml diff --git a/config/testacular.conf.js b/config/testacular.conf.js index 58b08c976b..c376e70132 100644 --- a/config/testacular.conf.js +++ b/config/testacular.conf.js @@ -15,14 +15,12 @@ autoWatch = true; browsers = ['Chrome']; singleRun = true; + reporters = ['dots', 'junit']; junitReporter = { - outputFile: 'test-results.xml' -}; + outputFile: 'test-results.xml', + suite: 'unit' -/* -junitReporter = { - outputFile: 'test_out/unit.xml', - suite: 'unit' }; -*/ + + diff --git a/jenkins.xml b/jenkins.xml index 4a27a0282b..2faf3424cf 100644 --- a/jenkins.xml +++ b/jenkins.xml @@ -1,7 +1,7 @@ - Build and test the node.js app + Build and test the Angular.js seed app 60 -1 @@ -74,26 +74,25 @@ +export DISPLAY=:1 +Xvfb :1 & + node_version=v0.8.14 -file_name=node-$node_version-linux-x64 +install_name=node-$node_version-linux-x64 +node_home=$PWD/$install_name -if [ ! -e $file_name ] +if [ ! -e $install_name.tar.gz ] then - wget http://nodejs.org/dist/$node_version/$file_name.tar.gz - tar xf $file_name.tar.gz + wget http://nodejs.org/dist/$node_version/$install_name.tar.gz + tar xf $install_name.tar.gz + $node_home/bin/npm install -g testacular fi -rm -rf target -mkdir target -node_dir=$PWD/$file_name -cd app -$node_dir/bin/npm install -$node_dir/bin/npm test +export PATH=$PATH:$node_home/bin +scripts/test.sh -rm -rf ../target/app.zip -zip -r ../target/app.zip * diff --git a/jenkins_busted.xml b/jenkins_busted.xml deleted file mode 100644 index 1e34ff6dcc..0000000000 --- a/jenkins_busted.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - Build and test the node.js app - - 60 - -1 - -1 - 20 - - false - - - - - - - false - - (jenkins) - ${account} - - - - - - 2 - - - - - ${repositoryUrl} - - - - - ** - - - false - false - false - false - false - false - false - false - false - false - - Default - - - - - - - - false - - - - true - false - false - false - (Default) - - - - - - false - - - - -#enable x11 -export DISPLAY=:1 -Xvfb :1 & - -node_version=v0.8.14 - -file_name=node-$node_version-linux-x64 - -if [ ! -e $file_name ] -then - wget http://nodejs.org/dist/$node_version/$file_name.tar.gz - tar xf $file_name.tar.gz -fi -rm -rf target -mkdir target - -node_dir=$PWD/$file_name - -$node_dir/bin/npm install -g testacular -scripts/test.sh - - - - - - (jenkins) - ${account} - - - ${applicationName} - - - https://api.cloudbees.com/api - target/*.zip - - - - - - - - \ No newline at end of file From 5fde2f04a80b8bcdf4a60324a3637ef84d85c389 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Fri, 25 Jan 2013 15:08:37 +1100 Subject: [PATCH 06/18] build fix and doco update --- README.md | 6 ++++++ jenkins.xml | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 68f3fd301a..fd075318f3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +# Welcome to AngularJS on CloudBees + +If you are running this app running - CloudBees - well done. If not, you can run it by +going to http://developer.cloudbees.com and pressing the angular button ! - an embedded node.js app is serving this up. +Replace it with what you want. Enjoy. + # angular-seed — the seed for AngularJS apps This project is an application skeleton for a typical [AngularJS](http://angularjs.org/) web app. diff --git a/jenkins.xml b/jenkins.xml index 2faf3424cf..c1f479e76d 100644 --- a/jenkins.xml +++ b/jenkins.xml @@ -77,8 +77,11 @@ export DISPLAY=:1 Xvfb :1 & -node_version=v0.8.14 +# +# Fetch node and testacular if we don't have it already +# +node_version=v0.8.14 install_name=node-$node_version-linux-x64 node_home=$PWD/$install_name @@ -89,10 +92,23 @@ then $node_home/bin/npm install -g testacular fi +# +# run the Angular.js tests (using a browser on the build server) +# export PATH=$PATH:$node_home/bin scripts/test.sh +# +# package the app for the CloudBees node.js stack (deployer picks it up) +# + +sed 's/8000/process.env.PORT/g' scripts/web-server.js > app/main.js +cp README.md app +cd app +mkdir -p ../target +rm -rf ../target/app.zip +zip -r ../target/app.zip * From 31c26d765c3666ad36d70d639456977accb8cddc Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Fri, 25 Jan 2013 15:14:08 +1100 Subject: [PATCH 07/18] clickstart changes only --- clickstart.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clickstart.json b/clickstart.json index 7a6d29c93b..8985a6ea60 100644 --- a/clickstart.json +++ b/clickstart.json @@ -1,12 +1,12 @@ { "id": "angularjs-clickstart", - "name": "Angular js goodness", + "name": "Angular js - HTML enhanced for web apps.", "source": "github", - "description" : "test and deploy an angular js app", - "icon" : "https://d3ko533tu1ozfq.cloudfront.net/clickstart/nodejs_large.png", + "description" : "Setup a build pipeline, Chrome based test and deploy it", + "icon" : "https://d3ko533tu1ozfq.cloudfront.net/clickstart/angularjs.png", "supported-by" : "community", - "order" : 10, + "order" : 5, "runtime": { "type": "nodejs", From 842a8f6768f53c5f0881098944227f71b8d3b15f Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Fri, 25 Jan 2013 15:20:48 +1100 Subject: [PATCH 08/18] description improve --- clickstart.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clickstart.json b/clickstart.json index 8985a6ea60..6cb21601c0 100644 --- a/clickstart.json +++ b/clickstart.json @@ -2,7 +2,7 @@ "id": "angularjs-clickstart", "name": "Angular js - HTML enhanced for web apps.", "source": "github", - "description" : "Setup a build pipeline, Chrome based test and deploy it", + "description" : "Setup a Jenkins build running Angular tests with Chrome and deploy it", "icon" : "https://d3ko533tu1ozfq.cloudfront.net/clickstart/angularjs.png", "supported-by" : "community", From 674571cb08b2aef704331f5c04e84d757ba1176b Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Fri, 25 Jan 2013 15:24:53 +1100 Subject: [PATCH 09/18] link and comment --- clickstart.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clickstart.json b/clickstart.json index 6cb21601c0..ddfd261d92 100644 --- a/clickstart.json +++ b/clickstart.json @@ -1,8 +1,8 @@ { "id": "angularjs-clickstart", - "name": "Angular js - HTML enhanced for web apps.", + "name": "Angular js - HTML enhanced for web apps", "source": "github", - "description" : "Setup a Jenkins build running Angular tests with Chrome and deploy it", + "description" : "Setup a Jenkins running Angular tests (with Chrome) and deploy the 'seed' app", "icon" : "https://d3ko533tu1ozfq.cloudfront.net/clickstart/angularjs.png", "supported-by" : "community", @@ -17,7 +17,7 @@ "build-with-jenkins": { "template": { - "type": "https://raw.github.com/michaelneale/angular-seed/master/jenkins.xml", + "type": "https://raw.github.com/CloudBees-community/angular-seed/master/jenkins.xml", "options": { } } From 0efcdf97ecdcc4cb4bf1413a684659dbe3e3dd35 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Fri, 25 Jan 2013 15:34:55 +1100 Subject: [PATCH 10/18] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fd075318f3..79f4ae4c9b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ -# Welcome to AngularJS on CloudBees +# Welcome to Angular.JS on CloudBees -If you are running this app running - CloudBees - well done. If not, you can run it by -going to http://developer.cloudbees.com and pressing the angular button ! - an embedded node.js app is serving this up. -Replace it with what you want. Enjoy. +This is a "ClickStart" version of the Angular.js "seed" starting point. You can launch it new by going to +http://developer.cloudbees.com and pressing the angular button. It will setup a Jenkins build running the test suite +with testacular and Chrome, and then, should it pass the tests, deploys this served up from a tiny node.js server (you +can then clone and mess with it, or change the backend to what you need). # angular-seed — the seed for AngularJS apps From 112e0769d5e1237ec76afa366361127c33184405 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Fri, 25 Jan 2013 16:00:34 +1100 Subject: [PATCH 11/18] Update clickstart.json --- clickstart.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clickstart.json b/clickstart.json index ddfd261d92..da90c45c3c 100644 --- a/clickstart.json +++ b/clickstart.json @@ -17,7 +17,7 @@ "build-with-jenkins": { "template": { - "type": "https://raw.github.com/CloudBees-community/angular-seed/master/jenkins.xml", + "type": "https://raw.github.com/CloudBees-community/angular-js-clickstart/master/jenkins.xml", "options": { } } From 7fda0175f749f4444174390221b8f8dcc676de59 Mon Sep 17 00:00:00 2001 From: Michael Neale Date: Tue, 29 Jan 2013 10:58:51 +1100 Subject: [PATCH 12/18] Doco update --- app/index.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/index.html b/app/index.html index 15a2334357..31e7cf010a 100644 --- a/app/index.html +++ b/app/index.html @@ -6,6 +6,14 @@ + + + +

Welcome to AngularJS on CloudBees - test and deploy your Angular app

+

Next steps:

  • Make sure you have an ssh public key setup on + Cloudbees and then run:
  • git clone ssh://git@git.cloudbees.com//.git
  • Make your changes and then push to the git repo
  • This will trigger a build and deploy cycle on cloudbees

+
+