diff --git a/src/model/unity/runner/runner-image-tag.test.ts b/src/model/unity/runner/runner-image-tag.test.ts index 829b13a2..bc460ede 100644 --- a/src/model/unity/runner/runner-image-tag.test.ts +++ b/src/model/unity/runner/runner-image-tag.test.ts @@ -91,7 +91,11 @@ describe('RunnerImageTag', () => { } }); - it('returns no specific build platform for generic targetPlatforms', () => { + // Real bug (game-ci/unity-activate#111): this used to resolve to an + // empty suffix, producing "ubuntu-2019.2.11f1-3" - a tag unityci/editor + // never publishes ("manifest unknown" on docker pull). NoTarget/generic + // now resolves to the same 'base' image StandaloneLinux64 uses. + it("resolves generic targetPlatforms to the 'base' image, not an empty suffix", () => { const image = new RunnerImageTag({ targetPlatform: 'NoTarget', hostPlatform: process.platform, @@ -99,10 +103,10 @@ describe('RunnerImageTag', () => { switch (process.platform) { case 'win32': - expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-3`); + expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-base-3`); break; case 'linux': - expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-3`); + expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-base-3`); break; } }); diff --git a/src/model/unity/runner/runner-image-tag.ts b/src/model/unity/runner/runner-image-tag.ts index 9b830ce3..75ad741e 100644 --- a/src/model/unity/runner/runner-image-tag.ts +++ b/src/model/unity/runner/runner-image-tag.ts @@ -54,7 +54,17 @@ class RunnerImageTag { static get targetPlatformSuffixes() { return { + // Used only by the internal 'Test' targetPlatform (unit-test + // scaffolding, never a real Docker pull) - kept as-is. generic: '', + // unityci/editor never publishes a bare "ubuntu--" tag - + // every real image has a module suffix. 'base' is the same image + // StandaloneLinux64 (pre-il2cpp) resolves to, and is what NoTarget + // actually needs: an editor image, not tied to any build target. + // Found via unity-activate#111's thin-wrapper CI: `game-ci activate` + // (which defaults targetPlatform to NoTarget, see #79) tried to pull + // "unityci/editor:ubuntu-2019.2.17f1-3" - manifest unknown. + noTarget: 'base', webgl: 'webgl', mac: 'mac-mono', windows: 'windows-mono', @@ -82,8 +92,21 @@ class RunnerImageTag { static getTargetPlatformToTargetPlatformSuffixMap(hostPlatform: string, targetPlatform: string, version: string) { log.info(hostPlatform, targetPlatform, version); - const { generic, webgl, mac, windows, windowsIl2cpp, wsaPlayer, linux, linuxIl2cpp, android, ios, tvos, facebook } = - RunnerImageTag.targetPlatformSuffixes; + const { + generic, + noTarget, + webgl, + mac, + windows, + windowsIl2cpp, + wsaPlayer, + linux, + linuxIl2cpp, + android, + ios, + tvos, + facebook, + } = RunnerImageTag.targetPlatformSuffixes; const [major, minor] = version.split('.').map(Number); @@ -148,7 +171,7 @@ class RunnerImageTag { case UnityTargetPlatform.Facebook: return facebook; case UnityTargetPlatform.NoTarget: - return generic; + return noTarget; // Test specific case UnityTargetPlatform.Test: