This commit is contained in:
@@ -47,9 +47,13 @@ function releaseBuildComponentTypes(imageTags: ImageTags | null | undefined) {
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isReleaseArtifactVisible(componentName: string, componentTypes: Map<string, string>) {
|
function isRuntimeOnlyImage(value: string) {
|
||||||
|
return /^(postgres|redis|mysql|mariadb|mongo|nginx|rabbitmq)(:|@)/i.test(value.trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
function isReleaseArtifactVisible(componentName: string, value: string, componentTypes: Map<string, string>) {
|
||||||
const type = componentTypes.get(componentName);
|
const type = componentTypes.get(componentName);
|
||||||
return type !== 'DATABASE' && type !== 'MIGRATION';
|
return type !== 'DATABASE' && type !== 'MIGRATION' && !isRuntimeOnlyImage(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function releaseArtifacts(release: AppRelease) {
|
function releaseArtifacts(release: AppRelease) {
|
||||||
@@ -57,10 +61,10 @@ function releaseArtifacts(release: AppRelease) {
|
|||||||
const componentTypes = releaseBuildComponentTypes(imageTags);
|
const componentTypes = releaseBuildComponentTypes(imageTags);
|
||||||
const values = [
|
const values = [
|
||||||
...Object.entries(imageTags?.images ?? {})
|
...Object.entries(imageTags?.images ?? {})
|
||||||
.filter(([componentName]) => isReleaseArtifactVisible(componentName, componentTypes))
|
.filter(([componentName, value]) => isReleaseArtifactVisible(componentName, value, componentTypes))
|
||||||
.map(([, value]) => value),
|
.map(([, value]) => value),
|
||||||
...Object.entries(imageTags?.artifacts ?? {})
|
...Object.entries(imageTags?.artifacts ?? {})
|
||||||
.filter(([componentName]) => isReleaseArtifactVisible(componentName, componentTypes))
|
.filter(([componentName, value]) => isReleaseArtifactVisible(componentName, value, componentTypes))
|
||||||
.map(([, value]) => value)
|
.map(([, value]) => value)
|
||||||
].filter(Boolean);
|
].filter(Boolean);
|
||||||
|
|
||||||
@@ -160,8 +164,8 @@ function nextReleaseVersion(releases: AppRelease[], appId: string, builds: Build
|
|||||||
function buildCount(release: AppRelease) {
|
function buildCount(release: AppRelease) {
|
||||||
const imageTags = release.imageTags as ImageTags | null | undefined;
|
const imageTags = release.imageTags as ImageTags | null | undefined;
|
||||||
const componentTypes = releaseBuildComponentTypes(imageTags);
|
const componentTypes = releaseBuildComponentTypes(imageTags);
|
||||||
const count = Object.keys(imageTags?.images ?? {}).filter((componentName) => isReleaseArtifactVisible(componentName, componentTypes)).length
|
const count = Object.entries(imageTags?.images ?? {}).filter(([componentName, value]) => isReleaseArtifactVisible(componentName, value, componentTypes)).length
|
||||||
+ Object.keys(imageTags?.artifacts ?? {}).filter((componentName) => isReleaseArtifactVisible(componentName, componentTypes)).length;
|
+ Object.entries(imageTags?.artifacts ?? {}).filter(([componentName, value]) => isReleaseArtifactVisible(componentName, value, componentTypes)).length;
|
||||||
return count || (release.artifact ? 1 : 0);
|
return count || (release.artifact ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user