feat(image): build image with file [BE-11372] (#171)

release/2.25
Oscar Zhou 2024-11-28 10:33:35 +13:00 committed by GitHub
parent 4f708309af
commit 4046bf7b31
1 changed files with 6 additions and 1 deletions

View File

@ -57,10 +57,15 @@ export async function buildImageFromDockerfileContentAndFiles(
const dockerfile = new Blob([content], { type: 'text/plain' }); const dockerfile = new Blob([content], { type: 'text/plain' });
const uploadFiles = [dockerfile, ...files]; const uploadFiles = [dockerfile, ...files];
const formData = new FormData();
uploadFiles.forEach((file, index) => {
formData.append(`file${index}`, file);
});
return buildImage( return buildImage(
environmentId, environmentId,
{ t: names }, { t: names },
{ file: uploadFiles }, formData,
'multipart/form-data' 'multipart/form-data'
); );
} }