Keep the app source archive with the app instance data dir
This commit is contained in:
+3
-4
@@ -205,12 +205,11 @@ async function install(req, res, next) {
|
||||
|
||||
data.appStoreId = result.appStoreId;
|
||||
data.manifest = result.manifest;
|
||||
data.sourceArchiveFilePath = req.files.sourceArchive?.path || null;
|
||||
|
||||
// if we have a source archive upload, craft a custom docker image URI for later
|
||||
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}`;
|
||||
if (data.sourceArchiveFilePath) {
|
||||
data.manifest.dockerImage = `local/${data.manifest.id}:${data.manifest.version}-${Date.now()}`;
|
||||
}
|
||||
|
||||
[error, result] = await safe(apps.install(data, AuditSource.fromRequest(req)));
|
||||
|
||||
Reference in New Issue
Block a user