strong-deploy
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -11,4 +11,5 @@ usage: %MAIN% [options] URL [PACK|BRANCH] | ||
Arguments: | ||
URL The URL of the StrongLoop process manager | ||
eg: http://127.0.0.1:7777 | ||
URL The URL of the StrongLoop process manager, eg: http://127.0.0.1:7777 | ||
If the server requires authentication, the credentials must be part | ||
of the URL, eg: http://user:pass@127.0.0.1:7777 | ||
PACK Deploy an NPM package/tarball. | ||
@@ -15,0 +16,0 @@ BRANCH Deploy a git branch. |
@@ -0,1 +1,13 @@ | ||
2015-02-09, Version 1.1.4 | ||
========================= | ||
* deps: make async a regular dependency (Ryan Graham) | ||
* Give useful error message when auth is required (Ryan Graham) | ||
* docs: document implicit support for HTTP auth (Ryan Graham) | ||
* test: use strong-fork-cicada for tests (Ryan Graham) | ||
2015-01-20, Version 1.1.3 | ||
@@ -2,0 +14,0 @@ ========================= |
@@ -6,2 +6,4 @@ var async = require('async'); | ||
var util = require('util'); | ||
var urlParse = require('url').parse; | ||
var urlFormat = require('url').format; | ||
@@ -46,3 +48,8 @@ function getCurrentBranch(workingDir) { | ||
debug(err); | ||
console.error('URL `%s` is not valid', url); | ||
if (urlFormat(urlParse(url)) == url) { | ||
console.error('Cannot access remote. Does git require authentication?'); | ||
console.error('If authentication is required, credentials should be given in the URL.'); | ||
} else { | ||
console.error('URL `%s` is not valid', url); | ||
} | ||
err = Error('invalid url'); | ||
@@ -49,0 +56,0 @@ } |
@@ -40,2 +40,5 @@ var fs = require('fs'); | ||
); | ||
if (res.statusCode === 401 || res.statusCode === 403) { | ||
console.error('Valid credentials must be given in the URL'); | ||
} | ||
callback(Error('HTTP error')); | ||
@@ -42,0 +45,0 @@ }); |
{ | ||
"name": "strong-deploy", | ||
"description": "Deploy a node application to a StrongLoop process manager", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"keywords": [ | ||
@@ -36,2 +36,3 @@ "StrongLoop", | ||
"dependencies": { | ||
"async": "^0.9.0", | ||
"debug": "^2.0.0", | ||
@@ -42,6 +43,6 @@ "shelljs": "^0.3.0", | ||
"devDependencies": { | ||
"tap": "^0.4.9", | ||
"cicada": "^1.1.1", | ||
"async": "^0.9.0" | ||
"http-auth": "^2.2.5", | ||
"strong-fork-cicada": "^1.1.2", | ||
"tap": "^0.4.9" | ||
} | ||
} |
@@ -24,4 +24,5 @@ # strong-deploy | ||
Arguments: | ||
URL The URL of the StrongLoop process manager | ||
eg: http://127.0.0.1:7777 | ||
URL The URL of the StrongLoop process manager, eg: http://127.0.0.1:7777 | ||
If the server requires authentication, the credentials must be part | ||
of the URL, eg: http://user:pass@127.0.0.1:7777 | ||
PACK Deploy an NPM package/tarball. | ||
@@ -28,0 +29,0 @@ BRANCH Deploy a git branch. |
var assert = require('assert'); | ||
var childProcess = require('child_process'); | ||
var cicada = require('cicada'); | ||
var debug = require('debug')('test'); | ||
var http = require('http'); | ||
var helpers = require('./helpers'); | ||
var shell = require('shelljs'); | ||
shell.exec('git branch deploy'); | ||
shell.rm('-rf', '.test_artifacts'); | ||
var ci = cicada('.test_artifacts'); | ||
var server = http.createServer(ci.handle); | ||
var ok = false; | ||
helpers.gitServer(test); | ||
ci.once('commit', function(commit) { | ||
assert(commit.repo === 'default'); | ||
var branch = 'deploy'; | ||
assert(!(branch instanceof Error)); | ||
assert(commit.branch === branch); | ||
ok = true; | ||
server.close(); | ||
}); | ||
function test(server, ci) { | ||
ci.once('commit', assertCommit); | ||
server.once('listening', function() { | ||
debug('Server started at: %j', server.address()); | ||
childProcess.fork( | ||
require.resolve('../bin/sl-deploy'), | ||
['http://127.0.0.1:' + server.address().port] | ||
['http://any:thin@127.0.0.1:' + server.address().port] | ||
); | ||
}); | ||
server.listen(0); | ||
function assertCommit(commit) { | ||
assert(commit.repo === 'default'); | ||
var branch = 'deploy'; | ||
assert(commit.branch === branch); | ||
helpers.ok = true; | ||
server.close(); | ||
} | ||
} |
var assert = require('assert'); | ||
var cicada = require('cicada'); | ||
var debug = require('debug')('test'); | ||
var http = require('http'); | ||
var helpers = require('./helpers'); | ||
var os = require('os'); | ||
var path = require('path'); | ||
var shell = require('shelljs'); | ||
var path = require('path'); | ||
var os = require('os'); | ||
@@ -12,19 +11,7 @@ var performGitDeployment = require('../lib/git').performGitDeployment; | ||
shell.exec('git branch deploy'); | ||
var artifactDir = path.join(__dirname, '.test_artifacts'); | ||
shell.rm('-rf', artifactDir); | ||
var ci = cicada(artifactDir); | ||
var server = http.createServer(ci.handle); | ||
var ok = false; | ||
ci.once('commit', function(commit) { | ||
assert(commit.repo === 'default'); | ||
var branch = 'deploy'; | ||
assert(!(branch instanceof Error)); | ||
assert(commit.branch === branch); | ||
ok = true; | ||
server.close(); | ||
}); | ||
helpers.gitServer(test); | ||
server.once('listening', function() { | ||
debug('Server started at: %j', server.address()); | ||
function test(server, ci) { | ||
ci.once('commit', assertCommit); | ||
var workingDir = __dirname; | ||
@@ -38,4 +25,11 @@ var baseUrl = 'http://127.0.0.1:' + server.address().port; | ||
}); | ||
}); | ||
server.listen(0); | ||
function assertCommit(commit) { | ||
assert(commit.repo === 'default'); | ||
var branch = 'deploy'; | ||
assert(!(branch instanceof Error)); | ||
assert(commit.branch === branch); | ||
helpers.ok = true; | ||
server.close(); | ||
} | ||
} |
var assert = require('assert'); | ||
var childProcess = require('child_process'); | ||
var cicada = require('cicada'); | ||
var debug = require('debug')('test'); | ||
var http = require('http'); | ||
var shell = require('shelljs'); | ||
var helpers = require('./helpers'); | ||
var getCurrentBranch = require('../lib/git.js')._getCurrentBranch; | ||
shell.rm('-rf', '.test_artifacts'); | ||
var ci = cicada('.test_artifacts'); | ||
var server = http.createServer(ci.handle); | ||
var ok = false; | ||
var currentBranch = getCurrentBranch(process.cwd()); | ||
@@ -26,11 +20,4 @@ | ||
ci.once('commit', function(commit) { | ||
assert(commit.repo === 'repo2'); | ||
assert(commit.branch === pushBranch); | ||
ok = true; | ||
server.close(); | ||
}); | ||
server.once('listening', function() { | ||
debug('Server started at: %j', server.address()); | ||
helpers.gitServer(function(server, ci) { | ||
ci.once('commit', assertCommit); | ||
childProcess.fork( | ||
@@ -40,4 +27,9 @@ require.resolve('../bin/sl-deploy'), | ||
); | ||
function assertCommit(commit) { | ||
assert(commit.repo === 'repo2'); | ||
assert(commit.branch === pushBranch); | ||
helpers.ok = true; | ||
server.close(); | ||
} | ||
}); | ||
server.listen(0); |
var assert = require('assert'); | ||
var http = require('http'); | ||
var childProcess = require('child_process'); | ||
var helpers = require('./helpers'); | ||
var ok = false; | ||
var server = http.createServer(function(req, res) { | ||
var server = helpers.httpServer(assertPut, doPut); | ||
function assertPut(req, res) { | ||
assert(req.url === '/repo2'); | ||
assert(req.method === 'PUT'); | ||
ok = true; | ||
helpers.ok = true; | ||
res.end(); | ||
server.close(); | ||
}); | ||
server.listen(0); | ||
} | ||
server.on('listening', function() { | ||
function doPut(server, _ci) { | ||
var port = server.address().port; | ||
@@ -22,2 +22,2 @@ childProcess.fork( | ||
); | ||
}); | ||
} |
@@ -6,2 +6,3 @@ var assert = require('assert'); | ||
var util = require('util'); | ||
var helpers = require('./helpers'); | ||
@@ -23,11 +24,2 @@ require('shelljs/global'); | ||
// Check for node silently exiting with code 0 when tests have not passed. | ||
var ok = false; | ||
process.on('exit', function(code) { | ||
if (code === 0) { | ||
assert(ok); | ||
} | ||
}); | ||
function expectError(er) { | ||
@@ -68,3 +60,3 @@ if (er) { | ||
assert.ifError(er); | ||
ok = true; | ||
helpers.ok = true; | ||
}); |
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
Network access
Supply chain riskThis module accesses the network.
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
30485
22
584
32
4
12
+ Addedasync@^0.9.0
+ Addedasync@0.9.2(transitive)