Commit 546e3813 authored by Girish Ramakrishnan's avatar Girish Ramakrishnan

skip downloading image if image present locally

if we use build service app locally (without push), then we can skip
the download altogether.
parent 9d1bb29a
......@@ -2124,4 +2124,5 @@
* branding: footer can have template variables like %YEAR% and %VERSION%
* sftp: secure the API with a token
* filemanager: Add extract context menu item
* Do not download docker images if present locally
......@@ -170,13 +170,19 @@ function downloadImage(manifest, callback) {
debug('downloadImage %s', manifest.dockerImage);
var attempt = 1;
const image = gConnection.getImage(manifest.dockerImage);
async.retry({ times: 10, interval: 5000, errorFilter: e => e.reason !== BoxError.NOT_FOUND }, function (retryCallback) {
debug('Downloading image %s. attempt: %s', manifest.dockerImage, attempt++);
image.inspect(function (error, result) {
if (!error && result) return callback(null); // image is already present locally
pullImage(manifest, retryCallback);
}, callback);
let attempt = 1;
async.retry({ times: 10, interval: 5000, errorFilter: e => e.reason !== BoxError.NOT_FOUND }, function (retryCallback) {
debug('Downloading image %s. attempt: %s', manifest.dockerImage, attempt++);
pullImage(manifest, retryCallback);
}, callback);
});
}
function getBindsSync(app) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment