blob: cad5154d7f5dd30b730b9a2c5de728193c291e31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
module.exports = tag
var assert = require("assert")
function tag (uri, params, cb) {
assert(typeof uri === "string", "must pass registry URI to tag")
assert(params && typeof params === "object", "must pass params to tag")
assert(typeof cb === "function", "must pass callback to tag")
assert(typeof params.version === "string", "must pass version to tag")
assert(typeof params.tag === "string", "must pass tag name to tag")
assert(
params.auth && typeof params.auth === "object",
"must pass auth to tag"
)
var options = {
method : "PUT",
body : JSON.stringify(params.version),
auth : params.auth
}
this.request(uri+"/"+params.tag, options, cb)
}
|