kit-deployer
Advanced tools
Comparing version 7.1.0 to 7.2.0
{ | ||
"name": "kit-deployer", | ||
"version": "7.1.0", | ||
"version": "7.2.0", | ||
"description": "Use to deploy files to multiple kubernetes clusters.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -155,2 +155,3 @@ <p align="center"> | ||
| `DRY_RUN` | Will only show the diff and will not push anything to the cluster | yes | `true` | | ||
| `DEBUG` | A boolean flag to enable debug mode | yes | `false` | | ||
| `IS_ROLLBACK` | A boolean flag that is passed in the available payload post | yes | `false` | | ||
@@ -157,0 +158,0 @@ | `DIFF` | Will show a diff | yes | `false` | |
@@ -42,2 +42,3 @@ "use strict"; | ||
* @param {string} checkAvailable | ||
* @fires Dependencies#debug | ||
* @fires Dependencies#info | ||
@@ -52,3 +53,3 @@ */ | ||
if (selector) { | ||
this.emit("info", "Dependency detected for " + manifest.metadata.name + " <= " + selector); | ||
this.emit("debug", "Dependency detected for " + manifest.metadata.name + " <= " + selector); | ||
// Only check for dependency availablity if enabled | ||
@@ -55,0 +56,0 @@ if (checkAvailable) { |
@@ -23,2 +23,3 @@ "use strict"; | ||
isRollback: false, | ||
debug: false, | ||
diff: false, | ||
@@ -74,2 +75,5 @@ force: false, | ||
}); | ||
webhook.on("debug", (msg) => { | ||
self.emit("debug", msg); | ||
}); | ||
webhook.on("info", (msg) => { | ||
@@ -87,2 +91,5 @@ self.emit("info", msg); | ||
function clusterDebug(message) { | ||
self.emit("debug", config.metadata.name + " - " + message); | ||
} | ||
function clusterLog(message) { | ||
@@ -119,2 +126,3 @@ self.emit("info", config.metadata.name + " - " + message); | ||
}); | ||
namespaces.on("debug", clusterDebug); | ||
namespaces.on("info", clusterLog); | ||
@@ -150,4 +158,5 @@ namespaces.on("error", clusterError); | ||
}); | ||
manifests.on("debug", clusterDebug); | ||
manifests.on("info", clusterLog); | ||
manifests.on("warning", clusterWarning); | ||
manifests.on("warn", clusterWarning); | ||
manifests.on("error", (msg) => { | ||
@@ -175,3 +184,3 @@ clusterError(msg); | ||
if (self.options.dryRun) { | ||
self.emit("info", "This was a dry run and no changes were deployed"); | ||
self.emit("debug", "This was a dry run and no changes were deployed"); | ||
} | ||
@@ -178,0 +187,0 @@ if (errors.length) { |
@@ -119,2 +119,5 @@ "use strict"; | ||
}); | ||
dependencies.on("debug", (msg) => { | ||
this.emit("debug", msg); | ||
}); | ||
dependencies.on("info", (msg) => { | ||
@@ -133,2 +136,5 @@ this.emit("info", msg); | ||
}); | ||
status.on("debug", (msg) => { | ||
this.emit("debug", msg); | ||
}); | ||
status.on("info", (msg) => { | ||
@@ -152,5 +158,5 @@ this.emit("info", msg); | ||
if (this.options.selector) { | ||
this.emit("info", "Getting list of " + this.supportedTypes.join(",") + " matching '" + this.options.selector + "'"); | ||
this.emit("debug", "Getting list of " + this.supportedTypes.join(",") + " matching '" + this.options.selector + "'"); | ||
} else { | ||
this.emit("info", "Getting list of " + this.supportedTypes.join(",")); | ||
this.emit("debug", "Getting list of " + this.supportedTypes.join(",")); | ||
} | ||
@@ -177,3 +183,3 @@ | ||
.then(() => { | ||
this.emit("info", "Generating tmp directory: " + tmpDir); | ||
this.emit("debug", "Generating tmp directory: " + tmpDir); | ||
return mkdirp(tmpDir); | ||
@@ -188,3 +194,3 @@ }) | ||
if (Array.isArray(manifestFiles) && manifestFiles.length === 0) { | ||
this.emit("info", "No cluster files to processs, skipping " + this.options.cluster.metadata.name); | ||
this.emit("debug", "No cluster files to processs, skipping " + this.options.cluster.metadata.name); | ||
return Promise.resolve(); | ||
@@ -213,3 +219,3 @@ } | ||
if (this.supportedTypes.indexOf(manifest.kind.toLowerCase()) < 0) { | ||
this.emit("warning", "Skipping " + manifestName + " because " + manifest.kind + " is unsupported"); | ||
this.emit("warn", "Skipping " + manifestName + " because " + manifest.kind + " is unsupported"); | ||
return; | ||
@@ -273,3 +279,3 @@ } | ||
if (committerDate && _.has(res, ["commit", "committer", "date"]) && committerDate.getTime() > new Date(res.commit.committer.date).getTime()) { | ||
this.emit("warning", "Skipping " + manifestName + " because cluster has newer commit"); | ||
this.emit("warn", "Skipping " + manifestName + " because cluster has newer commit"); | ||
return true; | ||
@@ -371,3 +377,3 @@ } | ||
.catch( (err) => { | ||
this.emit("warning", `Warning: (${(err ? err.message : "undefined")}) Backing up ${manifest.metadata.name} to ${this.options.cluster.metadata.name}`); | ||
this.emit("warn", `Warning: (${(err ? err.message : "undefined")}) Backing up ${manifest.metadata.name} to ${this.options.cluster.metadata.name}`); | ||
}); | ||
@@ -488,3 +494,3 @@ }) | ||
return rimraf(tmpDir).then(() => { | ||
this.emit("info", "Deleted tmp directory: " + tmpDir); | ||
this.emit("debug", "Deleted tmp directory: " + tmpDir); | ||
}); | ||
@@ -491,0 +497,0 @@ }); |
@@ -47,2 +47,3 @@ "use strict"; | ||
* @param {string} resource - A single resource type to watch | ||
* @fires Namespaces#debug | ||
* @fires Namespaces#info | ||
@@ -53,3 +54,3 @@ * @fires Namespaces#error | ||
return new Promise((resolve, reject) => { | ||
this.emit("info", "Getting list of namespaces"); | ||
this.emit("debug", "Getting list of namespaces"); | ||
this.kubectl | ||
@@ -56,0 +57,0 @@ .list("namespaces") |
@@ -130,6 +130,6 @@ "use strict"; | ||
if (generation !== null && observedGeneration !== null) { | ||
this.emit("info", resource + ":" + name + " has " + observedGeneration + "/" + generation + " observed generation"); | ||
this.emit("debug", resource + ":" + name + " has " + observedGeneration + "/" + generation + " observed generation"); | ||
} | ||
if (availableReplicas !== null && replicas !== null) { | ||
this.emit("info", resource + ":" + name + " has " + availableReplicas + "/" + replicas + " replicas available"); | ||
this.emit("debug", resource + ":" + name + " has " + availableReplicas + "/" + replicas + " replicas available"); | ||
} | ||
@@ -154,3 +154,3 @@ if ( | ||
if (succeeded !== null) { | ||
this.emit("info", resource + ":" + name + " has " + succeeded + "/1 succeeded"); | ||
this.emit("debug", resource + ":" + name + " has " + succeeded + "/1 succeeded"); | ||
if (succeeded) { | ||
@@ -172,3 +172,3 @@ stop(this); | ||
if (desiredNumberScheduled !== null && currentNumberScheduled !== null) { | ||
this.emit("info", resource + ":" + name + " has " + currentNumberScheduled + "/" + desiredNumberScheduled + " scheduled"); | ||
this.emit("debug", resource + ":" + name + " has " + currentNumberScheduled + "/" + desiredNumberScheduled + " scheduled"); | ||
if (desiredNumberScheduled >= currentNumberScheduled) { | ||
@@ -175,0 +175,0 @@ stop(this); |
@@ -11,2 +11,3 @@ "use strict"; | ||
* @fires Webhook#done | ||
* @fires Webhook#debug | ||
* @fires Webhook#info | ||
@@ -75,3 +76,3 @@ * @fires Webhook#error | ||
const phaseStatusMessage = urlWithService + " for " + name + " with status " + phase + "/" + status; | ||
this.emit("info", "Sending payload to " + phaseStatusMessage); | ||
this.emit("debug", "Sending payload to " + phaseStatusMessage); | ||
promises.push(request({ | ||
@@ -78,0 +79,0 @@ method: "POST", |
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
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
56591237
1767
183