mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-06 11:10:10 +00:00
Fix typing (don't assume that 'docker-toolbelt' uses Bluebird promises)
Change-type: patch
This commit is contained in:
parent
3199f15662
commit
099d755900
@ -365,8 +365,7 @@ export const pushAndUpdateServiceImages = function (
|
|||||||
Promise.all(
|
Promise.all(
|
||||||
images.map(({ serviceImage, localImage, props, logs }, index) =>
|
images.map(({ serviceImage, localImage, props, logs }, index) =>
|
||||||
Promise.all([
|
Promise.all([
|
||||||
// @ts-ignore
|
localImage.inspect().then((img) => img.Size),
|
||||||
localImage.inspect().get('Size'),
|
|
||||||
retry(
|
retry(
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
() => progress.push(localImage.name, reporters[index], opts),
|
() => progress.push(localImage.name, reporters[index], opts),
|
||||||
|
@ -30,13 +30,18 @@ const getBuilderLogPushEndpoint = function (baseUrl, buildId, owner, app) {
|
|||||||
return `https://builder.${baseUrl}/v1/pushLogs?${args}`;
|
return `https://builder.${baseUrl}/v1/pushLogs?${args}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {import('docker-toolbelt')} docker
|
||||||
|
* @param {string} imageId
|
||||||
|
* @param {string} bufferFile
|
||||||
|
*/
|
||||||
const bufferImage = function (docker, imageId, bufferFile) {
|
const bufferImage = function (docker, imageId, bufferFile) {
|
||||||
const streamUtils = require('./streams');
|
const streamUtils = require('./streams');
|
||||||
|
|
||||||
const image = docker.getImage(imageId);
|
const image = docker.getImage(imageId);
|
||||||
const imageMetadata = image.inspect();
|
const sizePromise = image.inspect().then((img) => img.Size);
|
||||||
|
|
||||||
return Promise.all([image.get(), imageMetadata.get('Size')]).then(
|
return Promise.all([image.get(), sizePromise]).then(
|
||||||
([imageStream, imageSize]) =>
|
([imageStream, imageSize]) =>
|
||||||
streamUtils.buffer(imageStream, bufferFile).then((bufferedStream) => {
|
streamUtils.buffer(imageStream, bufferFile).then((bufferedStream) => {
|
||||||
// @ts-ignore adding an extra property
|
// @ts-ignore adding an extra property
|
||||||
@ -150,13 +155,16 @@ const uploadLogs = function (logs, token, url, buildId, username, appName) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/**
|
||||||
opts must be a hash with the following keys:
|
* @param {import('docker-toolbelt')} docker
|
||||||
|
* @param {import('./logger')} logger
|
||||||
- appName: the name of the app to deploy to
|
* @param {string} token
|
||||||
- imageName: the name of the image to deploy
|
* @param {string} username
|
||||||
- buildLogs: a string with build output
|
* @param {string} url
|
||||||
- shouldUploadLogs
|
* @param {{appName: string; imageName: string; buildLogs: string; shouldUploadLogs: boolean}} opts
|
||||||
|
* - appName: the name of the app to deploy to
|
||||||
|
* - imageName: the name of the image to deploy
|
||||||
|
* - buildLogs: a string with build output
|
||||||
*/
|
*/
|
||||||
export const deployLegacy = async function (
|
export const deployLegacy = async function (
|
||||||
docker,
|
docker,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user