Standardize all references to Bluebird

Change-type: patch
This commit is contained in:
Pagan Gazzard
2020-06-23 11:29:03 +01:00
committed by Balena CI
parent cfbf00f543
commit 420a282bea
21 changed files with 125 additions and 125 deletions

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import * as Promise from 'bluebird';
import * as Bluebird from 'bluebird';
import { getVisuals } from './lazy';
const getBuilderPushEndpoint = function (baseUrl, owner, app) {
@ -36,7 +36,7 @@ const bufferImage = function (docker, imageId, bufferFile) {
const image = docker.getImage(imageId);
const imageMetadata = image.inspect();
return Promise.join(
return Bluebird.join(
image.get(),
imageMetadata.get('Size'),
(imageStream, imageSize) =>
@ -55,7 +55,7 @@ const showPushProgress = function (message) {
};
const uploadToPromise = (uploadRequest, logger) =>
new Promise(function (resolve, reject) {
new Bluebird(function (resolve, reject) {
const handleMessage = function (data) {
let obj;
data = data.toString();
@ -88,7 +88,7 @@ const uploadToPromise = (uploadRequest, logger) =>
});
/**
* @returns {Promise<{ buildId: number }>}
* @returns {Bluebird<{ buildId: number }>}
*/
const uploadImage = function (
imageStream,
@ -168,7 +168,7 @@ export const deployLegacy = function (
opts,
) {
const tmp = require('tmp');
const tmpNameAsync = Promise.promisify(tmp.tmpName);
const tmpNameAsync = Bluebird.promisify(tmp.tmpName);
// Ensure the tmp files gets deleted
tmp.setGracefulCleanup();
@ -187,7 +187,7 @@ export const deployLegacy = function (
// If the file was never written to (for instance because an error
// has occured before any data was written) this call will throw an
// ugly error, just suppress it
Promise.try(() => require('mz/fs').unlink(bufferFile)).catchReturn(
Bluebird.try(() => require('mz/fs').unlink(bufferFile)).catchReturn(
undefined,
),
);
@ -198,7 +198,7 @@ export const deployLegacy = function (
}
logger.logInfo('Uploading logs...');
return Promise.join(
return Bluebird.join(
logs,
token,
url,