diff --git a/packages/aws-rfdk/lib/deadline/lib/stage.ts b/packages/aws-rfdk/lib/deadline/lib/stage.ts index 16ad9e22e..3cd327c67 100644 --- a/packages/aws-rfdk/lib/deadline/lib/stage.ts +++ b/packages/aws-rfdk/lib/deadline/lib/stage.ts @@ -199,7 +199,8 @@ export class Stage { * @param id The construct ID */ public getVersion(scope: Construct, id: string): IVersion { - return new VersionQuery(scope, id, { version: this.manifest.version }); + const releaseVersion = this.getReleaseVersion(this.manifest.version); + return new VersionQuery(scope, id, { version: releaseVersion }); } /** @@ -218,4 +219,13 @@ export class Stage { ...recipe, }); } + + /** + * This removes the patch version from a full version string. No validation is done as that is handled + * in the constructor with the version check. + */ + private getReleaseVersion(fullVersion: string): string { + const versionComponents = fullVersion.split('.'); + return `${versionComponents[0]}.${versionComponents[1]}.${versionComponents[2]}`; + } } diff --git a/packages/aws-rfdk/lib/deadline/test/stage.test.ts b/packages/aws-rfdk/lib/deadline/test/stage.test.ts index 831f8ff5e..69d29fa0c 100644 --- a/packages/aws-rfdk/lib/deadline/test/stage.test.ts +++ b/packages/aws-rfdk/lib/deadline/test/stage.test.ts @@ -8,7 +8,8 @@ import * as path from 'path'; import { expect as expectCDK, - haveResource, + haveResourceLike, + stringLike, } from '@aws-cdk/assert'; import { App, @@ -400,7 +401,10 @@ describe('Stage', () => { // WHEN stage.getVersion(stack, 'Version'); - expectCDK(stack).to(haveResource('Custom::RFDK_DEADLINE_INSTALLERS')); + expectCDK(stack).to(haveResourceLike('Custom::RFDK_DEADLINE_INSTALLERS', { + forceRun: stringLike('*'), + versionString: '10.1.9', + })); }); }); }); diff --git a/packages/aws-rfdk/lib/deadline/test/thinkbox-docker-recipes.test.ts b/packages/aws-rfdk/lib/deadline/test/thinkbox-docker-recipes.test.ts index 0a6d745c7..fde6f4f76 100644 --- a/packages/aws-rfdk/lib/deadline/test/thinkbox-docker-recipes.test.ts +++ b/packages/aws-rfdk/lib/deadline/test/thinkbox-docker-recipes.test.ts @@ -8,6 +8,7 @@ import * as path from 'path'; import { expect as expectCDK, haveResourceLike, + stringLike, } from '@aws-cdk/assert'; import { DockerImageAsset } from '@aws-cdk/aws-ecr-assets'; import { @@ -57,7 +58,8 @@ describe('ThinkboxDockerRecipes', () => { const MINOR_VERSION = 1; const RELEASE_VERSION = 9; const PATCH_VERSION = 2; - const FULL_VERSION_STRING = `${MAJOR_VERSION}.${MINOR_VERSION}.${RELEASE_VERSION}.${PATCH_VERSION}`; + const RELEASE_VERSION_STRING = `${MAJOR_VERSION}.${MINOR_VERSION}.${RELEASE_VERSION}`; + const FULL_VERSION_STRING = `${RELEASE_VERSION_STRING}.${PATCH_VERSION}`; beforeEach(() => { app = new App(); @@ -139,7 +141,8 @@ describe('ThinkboxDockerRecipes', () => { }); expectCDK(stack).to(haveResourceLike('Custom::RFDK_DEADLINE_INSTALLERS', { - versionString: FULL_VERSION_STRING, + forceRun: stringLike('*'), + versionString: RELEASE_VERSION_STRING, })); });