forked from aws/aws-rfdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update stage-deadline script with new version index (#139)
* feat: add version-provider * feat: update stage-deadline script with new version index * fix: move version provider logic in separate script from handler Co-authored-by: Eugene Kozlov <kozlove@dev-dsk-kozlove-2b-2198d727.us-west-2.amazon.com>
- Loading branch information
1 parent
cee7099
commit fcb926e
Showing
6 changed files
with
829 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"Deadline": { | ||
"versions": { | ||
"10": { | ||
"1": { | ||
"8": { | ||
"5": { | ||
"linux": { | ||
"bundle": "s3://thinkbox-installers/Deadline/10.1.8.5/Linux/Deadline-10.1.8.5-linux-installers.tar", | ||
"clientInstaller": "s3://thinkbox-installers/Deadline/10.1.8.5/Linux/DeadlineClient-10.1.8.5-linux-x64-installer.run", | ||
"repositoryInstaller": "s3://thinkbox-installers/Deadline/10.1.8.5/Linux/DeadlineRepository-10.1.8.5-linux-x64-installer.run" | ||
}, | ||
"mac": { | ||
"bundle": "s3://thinkbox-installers/Deadline/10.1.8.5/Mac/Deadline-10.1.8.5-osx-installers.dmg" | ||
}, | ||
"windows": { | ||
"bundle": "s3://thinkbox-installers/Deadline/10.1.8.5/Windows/Deadline-10.1.8.5-windows-installers.zip", | ||
"clientInstaller": "s3://thinkbox-installers/Deadline/10.1.8.5/Windows/DeadlineClient-10.1.8.5-windows-installer.exe", | ||
"repositoryInstaller": "s3://thinkbox-installers/Deadline/10.1.8.5/Windows/DeadlineRepository-10.1.8.5-windows-installer.exe" | ||
} | ||
} | ||
}, | ||
"9": { | ||
"2": { | ||
"linux": { | ||
"bundle": "s3://thinkbox-installers/Deadline/10.1.9.2/Linux/Deadline-10.1.9.2-linux-installers.tar", | ||
"clientInstaller": "s3://thinkbox-installers/Deadline/10.1.9.2/Linux/DeadlineClient-10.1.9.2-linux-x64-installer.run", | ||
"repositoryInstaller": "s3://thinkbox-installers/Deadline/10.1.9.2/Linux/DeadlineRepository-10.1.9.2-linux-x64-installer.run" | ||
}, | ||
"mac": { | ||
"bundle": "s3://thinkbox-installers/Deadline/10.1.9.2/Mac/Deadline-10.1.9.2-osx-installers.dmg" | ||
}, | ||
"windows": { | ||
"bundle": "s3://thinkbox-installers/Deadline/10.1.9.2/Windows/Deadline-10.1.9.2-windows-installers.zip", | ||
"clientInstaller": "s3://thinkbox-installers/Deadline/10.1.9.2/Windows/DeadlineClient-10.1.9.2-windows-installer.exe", | ||
"repositoryInstaller": "s3://thinkbox-installers/Deadline/10.1.9.2/Windows/DeadlineRepository-10.1.9.2-windows-installer.exe" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"latest": { | ||
"linux": "10.1.9.2", | ||
"mac": "10.1.9.2", | ||
"windows": "10.1.8.5" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
packages/aws-rfdk/lib/core/lambdas/nodejs/version-provider/handler.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/** | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/* eslint-disable no-console */ | ||
|
||
import { LambdaContext } from '../lib/aws-lambda'; | ||
import { CfnRequestEvent, SimpleCustomResource } from '../lib/custom-resource'; | ||
import { | ||
VersionProvider, | ||
IVersionProviderProperties, | ||
IVersionedUris, | ||
Platform, | ||
} from './version-provider'; | ||
|
||
|
||
export class VersionProviderResource extends SimpleCustomResource { | ||
readonly versionProvider: VersionProvider; | ||
|
||
constructor(indexFilePath?: string) { | ||
super(); | ||
this.versionProvider = new VersionProvider(indexFilePath); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
/* istanbul ignore next */ // @ts-ignore | ||
public validateInput(data: object): boolean { | ||
return this.versionProvider.implementsIVersionProviderProperties(data); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
// @ts-ignore -- we do not use the physicalId | ||
public async doCreate(physicalId: string, resourceProperties: IVersionProviderProperties): Promise<Map<Platform, IVersionedUris>> { | ||
return await this.versionProvider.getVersionUris(resourceProperties); | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
/* istanbul ignore next */ // @ts-ignore | ||
public async doDelete(physicalId: string, resourceProperties: IVersionProviderProperties): Promise<void> { | ||
// Nothing to do -- we don't modify anything. | ||
return; | ||
} | ||
} | ||
|
||
/** | ||
* The handler used to provide the installer links for the requested version | ||
*/ | ||
/* istanbul ignore next */ | ||
export async function handler(event: CfnRequestEvent, context: LambdaContext): Promise<string> { | ||
const versionProvider = new VersionProviderResource(); | ||
return await versionProvider.handler(event, context); | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/aws-rfdk/lib/core/lambdas/nodejs/version-provider/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export * from './handler'; | ||
export * from './version-provider'; |
Oops, something went wrong.