Permalink
Browse files

Adding package.json, moving test data into testjenkinsapi.js

  • Loading branch information...
1 parent eb1df7b commit 4837d9aed084ddaa3ee4a17c9426128a21b1bbc4 @jansepar committed Dec 24, 2011
Showing with 67 additions and 59 deletions.
  1. +0 −59 jenkinsapi.js
  2. +13 −0 package.json
  3. +54 −0 testjenkinsapi.js
View
@@ -226,63 +226,4 @@ var init = exports.init = function(host) {
}
if (!module.parent) {
- var jenkins = init("http://github:thisismadness@jenkins.mobify.com");
- /*
- jenkins.build('crush-development', function(error, data) {
- if (error) {
- console.log(error);
- }
- console.log(data);
- });
- */
- //jenkins.all_jobs(function(error, data) { console.log(data)});
- /*
- jenkins.job_info('crush-madness', function(error, data) {
- if(!error) {
- console.log(data);
- }
-
- });
- */
- //jenkins.last_build_info('crush-development', function(error, data) { console.log(data); });
- //jenkins.last_build_report('crush-development', function(error, data) { console.log(data); });
-
- /*
- jenkins.get_config_xml('crush-development', function(error, data) {
- //console.log(data);
- jenkins.create_job('crush-copy', data, function(error, data) {
- //console.log(data);
- });
- });
- */
- /*
- jenkins.copy_job('crush-development'
- ,'crush-new'
- ,function(data) {
- return data.replace('development','feature-branch');
- }
- ,function(error, data) {
- //console.log(data);
- jenkins.delete_job('crush-new', function(error, data) {
- if(error) {
- console.log("error!");
- }
- console.log(data);
- });
- });
- */
- /*
- jenkins.delete_job('crush-new', function(error, data) {
- if(error) {
- console.log("error!");
- console.log(data.body, data.statusCode);
- }
- });
- */
- jenkins.last_result('crush-development', function(error, data) {
- console.log(data);
- });
- jenkins.last_success('crush-development', function(error, data) {
- console.log(data);
- });
}
View
@@ -0,0 +1,13 @@
+{
+ "name": "nodejs-jenkins-api",
+ "version": "0.1",
+ "description": "Jenkins API written in Node.js",
+ "author": "Shawn Jansepar <shawnjan@gmail.com>",
+ "dependencies": {
+ "request": ">= 2.2.9",
+ },
+ "repository" : {
+ "type" : "git",
+ "url" : "git@github.com:jansepar/nodejs-jenkins-api.git"
+ },
+}
View
@@ -0,0 +1,54 @@
+var jenkinsapi = require('./jenkinsapi');
+
+
+var jenkins = jenkinsapi.init("http://username:password@jenkins.yoursite.com");
+/*
+jenkins.build('crush-development', function(error, data) {
+ if (error) {
+ console.log(error);
+ }
+ console.log(data);
+});
+*/
+jenkins.all_jobs(function(error, data) { console.log(data)});
+/*
+jenkins.job_info('crush-madness', function(error, data) {
+ if(!error) {
+ console.log(data);
+ }
+
+ });
+*/
+//jenkins.last_build_info('crush-development', function(error, data) { console.log(data); });
+//jenkins.last_build_report('crush-development', function(error, data) { console.log(data); });
+
+/*
+jenkins.get_config_xml('crush-development', function(error, data) {
+ //console.log(data);
+ jenkins.create_job('crush-copy', data, function(error, data) {
+ //console.log(data);
+ });
+});
+*/
+/*
+jenkins.copy_job('crush-development'
+ ,'crush-new'
+ ,function(data) {
+ return data.replace('development','feature-branch');
+ }
+ ,function(error, data) {
+ //console.log(data);
+ jenkins.delete_job('crush-new', function(error, data) {
+ if(error) {
+ console.log("error!");
+ }
+ console.log(data);
+ });
+ });
+*/
+/*
+jenkins.delete_job('crush-new', function(error, data) {
+ if(error) {
+ console.log("error!");
+ console.log(data.body, data.statusCode);
+*/

0 comments on commit 4837d9a

Please sign in to comment.