taskcluster-client
Advanced tools
Comparing version 0.0.0-alpha to 0.0.0-alpha.1
@@ -15,3 +15,11 @@ /** | ||
/** | ||
Default location where task definitions can be fetched from. | ||
@constant | ||
*/ | ||
var DEFAULT_TASKCLUSTER_TASK_BUCKET = 'http://tasks.taskcluster.net'; | ||
/** | ||
@param {Object} [options] configuration details for TC. | ||
@param {Object} [options.queueUrl] protocol + host for queue url. | ||
@param {Object} [options.tasksUrl] protocol + host for tasks location. | ||
@return {Object} full configuration for taskcluster | ||
@@ -23,3 +31,4 @@ */ | ||
return { | ||
queueUrl: options.queueUrl || DEFAULT_TASKCLUSTER_QUEUE | ||
queueUrl: options.queueUrl || DEFAULT_TASKCLUSTER_QUEUE, | ||
tasksUrl: options.tasksUrl || DEFAULT_TASKCLUSTER_TASK_BUCKET | ||
}; | ||
@@ -26,0 +35,0 @@ } |
suite('exchange', function() { | ||
var exchange = require('./exchange'); | ||
suite('routingKey', function() { | ||
suite('#taskRoutingKey', function() { | ||
test('defaults', function() { | ||
assert.equal( | ||
exchange.routingKey(), | ||
exchange.taskRoutingKey(), | ||
'*.*.*.*.*.*.#' | ||
@@ -32,3 +32,3 @@ ); | ||
assert.equal( | ||
exchange.routingKey(object), | ||
exchange.taskRoutingKey(object), | ||
expected.join('.') | ||
@@ -35,0 +35,0 @@ ); |
@@ -65,3 +65,3 @@ /** | ||
var routingKey = exchange.routingKey({ | ||
var routingKey = exchange.taskRoutingKey({ | ||
provisionerId: 'aws-provisioner', | ||
@@ -74,3 +74,3 @@ workerType: 'ami-xfoo' | ||
*/ | ||
exports.routingKey = function routingKey(options) { | ||
exports.taskRoutingKey = function(options) { | ||
options = options || {}; | ||
@@ -77,0 +77,0 @@ |
@@ -6,3 +6,5 @@ module.exports = function(grunt) { | ||
'config.js', | ||
'exchange.js' | ||
'exchange.js', | ||
'queue.js', | ||
'factory/task.js' | ||
]; | ||
@@ -9,0 +11,0 @@ |
{ | ||
"name": "taskcluster-client", | ||
"version": "0.0.0-alpha", | ||
"version": "0.0.0-alpha.1", | ||
"description": "mozilla taskcluster client", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "make test" | ||
"test": "make test", | ||
"doc": "./node_modules/.bin/grunt jsdoc" | ||
}, | ||
@@ -26,4 +27,4 @@ "repository": { | ||
"superagent-promise": "0.0.0", | ||
"amqplib": "~0.1.3", | ||
"url-join": "0.0.1" | ||
"url-join": "0.0.1", | ||
"object-factory": "~0.1.2" | ||
}, | ||
@@ -30,0 +31,0 @@ "devDependencies": { |
@@ -7,4 +7,20 @@ # taskcluster-client | ||
## Environment configuration | ||
## Developing | ||
`TASKCLUSTER_QUEUE` - taskcluster queue location (defaults to queue.taskcluster.net) | ||
Right now both a simple Makefile AND a Gruntfile are used (based on | ||
whatever I felt had the best tooling)... The source of truth for | ||
commands is the package.json... See the scripts section for how to run | ||
project wide tooling. | ||
### Run all the tests | ||
```sh | ||
npm test | ||
``` | ||
### Generate the docs | ||
```sh | ||
npm run-script doc | ||
``` |
@@ -11,3 +11,3 @@ Its fairly easy to bind everything yourself with amqp but there is quite | ||
var exchange = require('taskcluster-client/exchange'); | ||
var route = exchange.routingKey(); | ||
var route = exchange.taskRoutingKey(); | ||
@@ -27,11 +27,16 @@ module.exports = new AmqpSchema({ | ||
// app.js | ||
var amqp = require('taskcluster-client/amqp'); | ||
var Queue = require('taskcluster-client/queue'); | ||
var amqp = require('amqplib'); | ||
var schema = require('./schema'); | ||
// declare your apps amqp schema (this is idempotent so you can run this | ||
safely on app startup). | ||
var api = new Queue(); | ||
amqp().then(function(connection) { | ||
return schema.define(connection); | ||
api.amqpConnectionString().then(funciton(credentials) { | ||
amqp.connect(credentials.url).then(function(connection) { | ||
// define your amqp schema (this is idempontent... | ||
return schema.define(connection); | ||
}); | ||
}); | ||
``` | ||
@@ -38,0 +43,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21480
22
524
26
1
1
+ Addedobject-factory@~0.1.2
+ Addedobject-factory@0.1.2(transitive)
- Removedamqplib@~0.1.3
- Removedamqplib@0.1.3(transitive)
- Removedbitsyntax@0.0.3(transitive)
- Removedbuffer-more-ints@0.0.2(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedinherits@2.0.4(transitive)
- Removedisarray@0.0.1(transitive)
- Removedreadable-stream@1.1.14(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedwhen@2.1.1(transitive)