Solution proposal to Issue Add customImage parameter #150 (#151)

* add customImage attribute

* add one more test for input passing && check for customImage == ''
This commit is contained in:
Kai Biermeier
2020-09-18 18:41:31 +02:00
committed by GitHub
parent cccd5074ea
commit 6a53a9e853
7 changed files with 37 additions and 2 deletions
+6 -1
View File
@@ -8,6 +8,7 @@ class ImageTag {
name = 'unity3d',
version = '2019.2.11f1',
platform,
customImage,
} = imageProperties;
if (!ImageTag.versionPattern.test(version)) {
@@ -24,7 +25,7 @@ class ImageTag {
ImageTag.imageSuffixes.generic,
);
Object.assign(this, { repository, name, version, platform, builderPlatform });
Object.assign(this, { repository, name, version, platform, builderPlatform, customImage });
}
static get versionPattern() {
@@ -82,6 +83,10 @@ class ImageTag {
toString() {
const { image, tag } = this;
if (this.customImage && this.customImage !== '') {
return this.customImage;
}
return `${image}:${tag}`;
}
}