fix(ci): Fix Docker images and npm registry URL in CI workflows

This commit is contained in:
2024-10-27 19:50:39 +01:00
parent 320b3ed9eb
commit 8f49f0cb4f
79 changed files with 2052 additions and 823 deletions

View File

@@ -2,8 +2,14 @@ import * as plugins from '../plugins.js';
import type { ImageManager } from './classes.imagemanager.js';
@plugins.smartdata.managed()
export class Image extends plugins.smartdata.SmartDataDbDoc<Image, plugins.servezoneInterfaces.data.IImage, ImageManager> {
public static async create(imageDataArg: Partial<plugins.servezoneInterfaces.data.IImage['data']>) {
export class Image extends plugins.smartdata.SmartDataDbDoc<
Image,
plugins.servezoneInterfaces.data.IImage,
ImageManager
> {
public static async create(
imageDataArg: Partial<plugins.servezoneInterfaces.data.IImage['data']>,
) {
const image = new Image();
image.id = await this.getNewId();
console.log(imageDataArg);
@@ -14,7 +20,7 @@ export class Image extends plugins.smartdata.SmartDataDbDoc<Image, plugins.serve
versions: [],
},
});
console.log((Image as any).saveableProperties)
console.log((Image as any).saveableProperties);
await image.save();
return image;
}
@@ -32,14 +38,10 @@ export class Image extends plugins.smartdata.SmartDataDbDoc<Image, plugins.serve
* note: this is relative to the storage method defined by the imageManager
*/
public async getStoragePath(versionStringArg: string) {
return `${this.data.name}:${versionStringArg}`.replace('/', '__')
return `${this.data.name}:${versionStringArg}`.replace('/', '__');
}
public async getWriteStream() {
}
public async getWriteStream() {}
public async getReadStream() {
}
}
public async getReadStream() {}
}

View File

@@ -35,8 +35,8 @@ export class ImageManager {
return {
image: await image.createSavableObject(),
};
}
)
},
),
);
this.typedrouter.addTypedHandler<plugins.servezoneInterfaces.requests.image.IRequest_GetImage>(
@@ -48,7 +48,7 @@ export class ImageManager {
return {
image: await image.createSavableObject(),
};
})
}),
);
this.typedrouter.addTypedHandler(
@@ -61,8 +61,8 @@ export class ImageManager {
});
await image.delete();
return {};
}
)
},
),
);
this.typedrouter.addTypedHandler(
@@ -75,11 +75,11 @@ export class ImageManager {
images: await Promise.all(
images.map((image) => {
return image.createSavableObject();
})
}),
),
};
}
)
},
),
);
this.typedrouter.addTypedHandler(
@@ -97,7 +97,7 @@ export class ImageManager {
}
const imageVersion = reqArg.versionString;
console.log(
`got request to push image version ${imageVersion} for image ${refImage.data.name}`
`got request to push image version ${imageVersion} for image ${refImage.data.name}`,
);
const imagePushStream = reqArg.imageStream;
(async () => {
@@ -111,13 +111,16 @@ export class ImageManager {
},
});
imagePushStream.writeToWebstream(smartWebDuplex.writable);
await this.dockerImageStore.storeImage(refImage.id, plugins.smartstream.SmartDuplex.fromWebReadableStream(smartWebDuplex.readable));
await this.dockerImageStore.storeImage(
refImage.id,
plugins.smartstream.SmartDuplex.fromWebReadableStream(smartWebDuplex.readable),
);
})();
return {
allowed: true,
};
}
)
},
),
);
this.typedrouter.addTypedHandler(
@@ -128,20 +131,20 @@ export class ImageManager {
id: reqArg.imageId,
});
const imageVersion = image.data.versions.find(
(version) => version.versionString === reqArg.versionString
(version) => version.versionString === reqArg.versionString,
);
const readable = this.imageDir.fastGetStream(
{
path: await image.getStoragePath(reqArg.versionString),
},
'webstream'
'webstream',
);
const imageVirtualStream = new plugins.typedrequest.VirtualStream();
return {
imageStream: imageVirtualStream,
};
}
)
},
),
);
}
@@ -151,7 +154,7 @@ export class ImageManager {
await this.cloudlyRef.config.appData.waitForAndGetKey('s3Descriptor');
console.log(this.cloudlyRef.config.data.s3Descriptor);
this.smartbucketInstance = new plugins.smartbucket.SmartBucket(
this.cloudlyRef.config.data.s3Descriptor
this.cloudlyRef.config.data.s3Descriptor,
);
const bucket = await this.smartbucketInstance.getBucketByName('cloudly-test');
await bucket.fastPut({ path: 'images/00init', contents: 'init' });