forked from codewars/codewars-runner-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush.js
37 lines (33 loc) · 1.08 KB
/
push.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//! Simple utility for pushing latest docker image with version tagged
var docker = require('./lib/docker'),
opts = require("nomnom")
.options({
image: {
abbr: 'i',
help: 'The image to push. No tag needed, it will automatically be appended. If empty the default will be used.'
},
version: {
abbr: 'v',
flag: true,
help: 'Print version and exit',
callback: function () {
return config.version
}
}
})
.help('This utility will rebuild the docker image for the latest version')
.parse();
// if no items where provided then push everything, including base
//if (opts._.length == 0)
//{
// opts._ = docker.imageNames();
// opts._.unshift('base');
//}
docker.imageChain(opts._, function(name, image, next)
{
console.log("Pushing " + image);
docker.push(image, function(code) {
console.log("Push " + image + " finished with code " + code);
next();
});
}).run();