use local/id:version-ts as docker image tag for locally built apps
This commit is contained in:
+5
-1
@@ -207,7 +207,11 @@ async function install(req, res, next) {
|
||||
data.manifest = result.manifest;
|
||||
|
||||
// if we have a source archive upload, craft a custom docker image URI for later
|
||||
if (req.files.sourceArchive?.path) data.manifest.dockerImage = 'file:' + req.files.sourceArchive.path;
|
||||
if (req.files.sourceArchive?.path) {
|
||||
const newFileName = `${data.manifest.id}:${data.manifest.version}-${Date.now()}`;
|
||||
if (!safe.fs.renameSync(req.files.sourceArchive?.path, `/tmp/${newFileName}`)) return next(new HttpError(500, 'unable to move source archive'));
|
||||
data.manifest.dockerImage = `local/${newFileName}`;
|
||||
}
|
||||
|
||||
[error, result] = await safe(apps.install(data, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
Reference in New Issue
Block a user