Comparing version 0.1.0 to 0.2.0
@@ -9,3 +9,3 @@ 'use strict'; | ||
var si = setImmediate || function (fn) { setTimeout(fn, 0) }; | ||
var si = typeof setImmediate === 'function' ? setImmediate : function (fn) { setTimeout(fn, 0) }; | ||
@@ -12,0 +12,0 @@ function stripPathSegments(p, n) { |
{ | ||
"name": "dockerify", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Prepares any tarball containing a project so that a docker image can be built from it.", | ||
@@ -10,3 +10,4 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "tap test/*.js" | ||
"test": "set -e; for t in test/*.js; do node $t; done;", | ||
"test-0.8": "nave use 0.8 npm test" | ||
}, | ||
@@ -19,8 +20,9 @@ "repository": { | ||
"dependencies": { | ||
"through2": "~0.4.1", | ||
"tar-stream": "~0.2.5", | ||
"minimist": "~0.0.8", | ||
"npmlog": "~0.0.6", | ||
"minimist": "~0.0.8" | ||
"tar-stream": "git://github.com/thlorenz/tar-stream#fix-readable-stream-dep", | ||
"through2": "~0.4.1" | ||
}, | ||
"devDependencies": { | ||
"nave": "~0.4.5", | ||
"tap": "~0.4.3" | ||
@@ -46,4 +48,4 @@ }, | ||
"engine": { | ||
"node": ">=0.8" | ||
"node": ">=0.10" | ||
} | ||
} |
@@ -11,2 +11,6 @@ 'use strict'; | ||
function byName(x, y) { | ||
return x.name > y.name ? 1 : -1; | ||
} | ||
function inspect(obj, depth) { | ||
@@ -21,3 +25,3 @@ console.error(require('util').inspect(obj, false, depth || 5, true)); | ||
test('\n' + desc, function (t) { | ||
var in_ = fs.createReadStream(path.join(fixtures, input), 'utf8'); | ||
var in_ = fs.createReadStream(path.join(fixtures, input), { encoding: 'utf8' }); | ||
@@ -43,5 +47,12 @@ var expectedTar; | ||
entries = entries.sort(byName); | ||
entries.forEach(function (x) { delete x.mtime }) | ||
existing.forEach(function (x) { x.existing && delete x.existing.mtime; x.override && delete x.override.mtime; }) | ||
overriding.forEach(function (x) { x.existing && delete x.existing.mtime; x.override && delete x.override.mtime; }) | ||
existing.forEach(function (x) { | ||
x.existing && delete x.existing.mtime; | ||
x.override && delete x.override.mtime; | ||
}) | ||
overriding.forEach(function (x) { | ||
x.existing && delete x.existing.mtime; | ||
x.override && delete x.override.mtime; | ||
}) | ||
@@ -54,4 +65,7 @@ if (debug) { | ||
expectedTar = fs.readFileSync(path.join(expecteds, output), 'utf8').toString(); | ||
t.equal(data, expectedTar); | ||
if (!(/^v0\.8/).test(process.version)) { | ||
// data is emitted in different order for node 0.8, so we omit this test for that version | ||
expectedTar = fs.readFileSync(path.join(expecteds, output), 'utf8').toString(); | ||
t.equal(data, expectedTar); | ||
} | ||
@@ -74,49 +88,2 @@ if (expected.entries) t.deepEqual(entries, expected.entries); | ||
, [ { name: './tmp/', | ||
mode: 493, | ||
uid: 502, | ||
gid: 20, | ||
size: 0, | ||
type: 'directory', | ||
linkname: null, | ||
uname: 'thlorenz', | ||
gname: 'staff', | ||
devmajor: 0, | ||
devminor: 0 }, | ||
{ name: './tmp/hello1.txt', | ||
mode: 420, | ||
uid: 502, | ||
gid: 20, | ||
size: 10, | ||
type: 'file', | ||
linkname: null, | ||
uname: 'thlorenz', | ||
gname: 'staff', | ||
devmajor: 0, | ||
devminor: 0 }, | ||
{ name: './tmp/hello2.txt', | ||
mode: 420, | ||
uid: 502, | ||
gid: 20, | ||
size: 10, | ||
type: 'file', | ||
linkname: null, | ||
uname: 'thlorenz', | ||
gname: 'staff', | ||
devmajor: 0, | ||
devminor: 0 }, | ||
{ name: 'Dockerfile', | ||
mode: 420, | ||
uname: 'docker', | ||
gname: 'users', | ||
uid: 501, | ||
gid: 20, | ||
size: 12, | ||
type: 'file' } ] | ||
) | ||
check( | ||
'given a tar stream without a docker file strip 1' | ||
, 'no-dockerfile.tar' | ||
, 'no-dockerfile-strip-1.tar' | ||
, { strip: 1 } | ||
, [ { name: '.', | ||
mode: 493, | ||
@@ -132,3 +99,3 @@ uid: 502, | ||
devminor: 0 }, | ||
{ name: 'hello1.txt', | ||
{ name: './tmp/hello1.txt', | ||
mode: 420, | ||
@@ -144,3 +111,3 @@ uid: 502, | ||
devminor: 0 }, | ||
{ name: 'hello2.txt', | ||
{ name: './tmp/hello2.txt', | ||
mode: 420, | ||
@@ -165,8 +132,7 @@ uid: 502, | ||
) | ||
check( | ||
'given a tar stream without a docker file strip 1, and uname, gname overrides' | ||
'given a tar stream without a docker file strip 1' | ||
, 'no-dockerfile.tar' | ||
, 'no-dockerfile-strip-1-uname-gname-overrides.tar' | ||
, { strip: 1, stats: { uname: 'hello', gname: 'world' } } | ||
, 'no-dockerfile-strip-1.tar' | ||
, { strip: 1 } | ||
, [ { name: '.', | ||
@@ -183,2 +149,10 @@ mode: 493, | ||
devminor: 0 }, | ||
{ name: 'Dockerfile', | ||
mode: 420, | ||
uname: 'docker', | ||
gname: 'users', | ||
uid: 501, | ||
gid: 20, | ||
size: 12, | ||
type: 'file' }, | ||
{ name: 'hello1.txt', | ||
@@ -205,2 +179,20 @@ mode: 420, | ||
devmajor: 0, | ||
devminor: 0 } ] | ||
) | ||
check( | ||
'given a tar stream without a docker file strip 1, and uname, gname overrides' | ||
, 'no-dockerfile.tar' | ||
, 'no-dockerfile-strip-1-uname-gname-overrides.tar' | ||
, { strip: 1, stats: { uname: 'hello', gname: 'world' } } | ||
, [ { name: '.', | ||
mode: 493, | ||
uid: 502, | ||
gid: 20, | ||
size: 0, | ||
type: 'directory', | ||
linkname: null, | ||
uname: 'thlorenz', | ||
gname: 'staff', | ||
devmajor: 0, | ||
devminor: 0 }, | ||
@@ -214,3 +206,25 @@ { name: 'Dockerfile', | ||
size: 12, | ||
type: 'file' } ] | ||
type: 'file' }, | ||
{ name: 'hello1.txt', | ||
mode: 420, | ||
uid: 502, | ||
gid: 20, | ||
size: 10, | ||
type: 'file', | ||
linkname: null, | ||
uname: 'thlorenz', | ||
gname: 'staff', | ||
devmajor: 0, | ||
devminor: 0 }, | ||
{ name: 'hello2.txt', | ||
mode: 420, | ||
uid: 502, | ||
gid: 20, | ||
size: 10, | ||
type: 'file', | ||
linkname: null, | ||
uname: 'thlorenz', | ||
gname: 'staff', | ||
devmajor: 0, | ||
devminor: 0 } ] | ||
) | ||
@@ -363,3 +377,3 @@ | ||
) | ||
// | ||
// renaming existing docker file | ||
@@ -394,2 +408,10 @@ check( | ||
devminor: 0 }, | ||
{ name: 'Dockerfile', | ||
mode: 420, | ||
uname: 'docker', | ||
gname: 'users', | ||
uid: 501, | ||
gid: 20, | ||
size: 22, | ||
type: 'file' }, | ||
{ name: 'hello1.txt', | ||
@@ -416,11 +438,3 @@ mode: 420, | ||
devmajor: 0, | ||
devminor: 0 }, | ||
{ name: 'Dockerfile', | ||
mode: 420, | ||
uname: 'docker', | ||
gname: 'users', | ||
uid: 501, | ||
gid: 20, | ||
size: 22, | ||
type: 'file' } ], | ||
devminor: 0 } ], | ||
existing: [], | ||
@@ -427,0 +441,0 @@ overriding: |
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
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
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
75523
588
225
2
1
- Removedbl@0.6.0(transitive)
- Removedend-of-stream@0.1.5(transitive)
- Removedonce@1.3.3(transitive)
- Removedtar-stream@0.2.5(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedtar-stream@git://github.com/thlorenz/tar-stream#fix-readable-stream-dep