kit-image-deployer
Advanced tools
Comparing version 3.3.5-PRERELEASE-github-abuse-updates.0 to 3.3.5
{ | ||
"name": "kit-image-deployer", | ||
"version": "3.3.5-PRERELEASE-github-abuse-updates.0", | ||
"version": "3.3.5", | ||
"description": "A service that can be used to update given yaml files within a git repository with a new docker image path.", | ||
@@ -41,11 +41,3 @@ "repository": { | ||
"src" | ||
], | ||
"publishConfig": { | ||
"tag": "PRERELEASE-github-abuse-updates" | ||
}, | ||
"release": { | ||
"fallbackTags": { | ||
"PRERELEASE-github-abuse-updates": "latest" | ||
} | ||
} | ||
] | ||
} |
@@ -8,2 +8,4 @@ <p align="center"> | ||
# kit-image-deployer | ||
**[DEPRECATED] Thanks for using this package, but we will no longer support it.** | ||
[ ![Codeship Status for InVisionApp/kit-image-deployer](https://codeship.com/projects/37301840-0ff1-0134-c5dd-5e067c09569b/status?branch=master)](https://codeship.com/projects/156829) | ||
@@ -10,0 +12,0 @@ [![Docker Repository on Quay](https://quay.io/repository/invision/kit-image-deployer/status "Docker Repository on Quay")](https://quay.io/repository/invision/kit-image-deployer) |
@@ -15,3 +15,3 @@ "use strict"; | ||
retries: 10, | ||
retryInterval: 30, | ||
retryIncrement: 30, // seconds | ||
docker: { | ||
@@ -67,2 +67,3 @@ registry: undefined, | ||
self.emitter.emit("request", "Getting an image file from github"); | ||
return self.github.getContent(imageRequest).then(imageResponse => { | ||
@@ -103,2 +104,8 @@ // get | ||
if (tries > self.options.retries) { | ||
self.emitter.emit( | ||
"error", | ||
`Unable to update the image file after ${ | ||
self.options.retries | ||
} attempts final error: ${lastError}` | ||
); | ||
return reject(lastError); | ||
@@ -130,2 +137,3 @@ } | ||
self.emitter.emit("request", "Updating an image file in github"); | ||
self.github | ||
@@ -146,13 +154,8 @@ .updateFile({ | ||
let errCode = err && err.code ? err.code : undefined; | ||
if (errCode && errCode >= 500) { | ||
// don't retry 500 errors | ||
reject(err); | ||
} else { | ||
self.emitter.emit( | ||
"error", | ||
`Error updating image file status code ${errCode}, will retry after delay` | ||
); | ||
// try again after a delay | ||
self.retryAfterDelay(tries, err, attempt); | ||
} | ||
self.emitter.emit( | ||
"backoff", | ||
`Error updating image file status code ${errCode}, will retry after a delay` | ||
); | ||
// try again after a delay | ||
self.retryAfterDelay(tries, err, attempt); | ||
}); | ||
@@ -193,3 +196,3 @@ } else { | ||
self.emitter.emit( | ||
"info", | ||
"request", | ||
`Image file didn't exist creating image file` | ||
@@ -209,18 +212,18 @@ ); | ||
}) | ||
.catch(() => { | ||
// try again | ||
attempt(err); | ||
.catch(err => { | ||
let errCode = err && err.code ? err.code : undefined; | ||
// try again after a delay | ||
self.emitter.emit( | ||
"backoff", | ||
`Error creating image file status code ${errCode}, will retry after a delay` | ||
); | ||
self.retryAfterDelay(tries, err, attempt); | ||
}); | ||
} else { | ||
if (errCode && errCode >= 500) { | ||
// don't retry 500 errors | ||
reject(err); | ||
} else { | ||
self.emitter.emit( | ||
"error", | ||
`Error creating image file status code ${errCode}, will retry after delay` | ||
); | ||
// try again after a delay | ||
self.retryAfterDelay(tries, err, attempt); | ||
} | ||
self.emitter.emit( | ||
"backoff", | ||
`Error getting image file status code ${errCode}, will retry after a delay` | ||
); | ||
// try again after a delay | ||
self.retryAfterDelay(tries, err, attempt); | ||
} | ||
@@ -251,29 +254,29 @@ }); | ||
.catch(reject); | ||
} else { | ||
const configRequest = { | ||
user: self.options.github.user, | ||
repo: self.options.github.repo, | ||
path: "kit.yaml" | ||
}; | ||
self.github | ||
.getContent(configRequest) | ||
.then(function(configResponse) { | ||
const rawConfig = new Buffer( | ||
configResponse.content, | ||
configResponse.encoding | ||
).toString("ascii"); | ||
const config = yaml.safeLoad(rawConfig); | ||
return self.attemptCommit( | ||
config, | ||
image, | ||
branch, | ||
committer, | ||
message, | ||
save | ||
); | ||
}) | ||
.then(resolve) | ||
.catch(reject); | ||
} | ||
const configRequest = { | ||
user: self.options.github.user, | ||
repo: self.options.github.repo, | ||
path: "kit.yaml" | ||
}; | ||
self.github | ||
.getContent(configRequest) | ||
.then(function(configResponse) { | ||
const rawConfig = new Buffer( | ||
configResponse.content, | ||
configResponse.encoding | ||
).toString("ascii"); | ||
const config = yaml.safeLoad(rawConfig); | ||
return self.attemptCommit( | ||
config, | ||
image, | ||
branch, | ||
committer, | ||
message, | ||
save | ||
); | ||
}) | ||
.then(resolve) | ||
.catch(reject); | ||
}); | ||
@@ -290,3 +293,3 @@ } | ||
retryAfterDelay(attempt, err, func) { | ||
let retryDelay = attempt * this.options.retryInterval * 1000; | ||
let retryDelay = attempt * this.options.retryIncrement * 1000; | ||
return setTimeout(() => { | ||
@@ -293,0 +296,0 @@ return func(err); |
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
19448
278
1
120
1