Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bin): Add simpler way to invoke stage-deadline #90

Merged
merged 5 commits into from
Sep 21, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions packages/aws-rfdk/bin/stage-deadline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const args = process.argv.slice(2);

let deadlineInstallerURI = '';
let dockerRecipesURI = '';
let deadlineRelease = '';
let outputFolder = './stage';
let verbose = false;

Expand All @@ -34,6 +35,11 @@ while (n < args.length) {
n++;
dockerRecipesURI = args[n];
break;
case '-r':
case '--release':
jusiskin marked this conversation as resolved.
Show resolved Hide resolved
n++;
deadlineRelease = args[n];
break;
case '-o':
case '--output':
n++;
Expand All @@ -49,6 +55,22 @@ while (n < args.length) {
n++;
}

// Automatically populate the installer & recipe URI using the version, if it is provided.
if (deadlineRelease !== '') {
if (!/^10\.\d+\.\d+\.\d+$/.test(deadlineRelease)) {
usage(1);
}

// installer URI only if not provided as an arg
if (deadlineInstallerURI === '') {
jusiskin marked this conversation as resolved.
Show resolved Hide resolved
deadlineInstallerURI = `s3://thinkbox-installers/Deadline/${deadlineRelease}/Linux/DeadlineClient-${deadlineRelease}-linux-x64-installer.run`;
}
// docker recipe URI only if not provided as an arg
if (dockerRecipesURI === '') {
dockerRecipesURI = `s3://thinkbox-installers/DeadlineDocker/${deadlineRelease}/DeadlineDocker-${deadlineRelease}.tar.gz`;
}
}

// Show help if URI for deadline installer or URI for docker is not specified.
if (deadlineInstallerURI === '' || dockerRecipesURI === '') {
usage(1);
Expand Down Expand Up @@ -179,10 +201,19 @@ The AWS CLI must be configured to authenticate using your AWS account. This can
See https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html for documentation on how to configure the AWS CLI.

Usage: stage-deadline [--output <output_dir>] [--verbose]
-r <deadline_release_version>
[-d <deadline_installer_uri>]
[-c <deadline_recipes_uri>]
OR
stage-deadline [--output <output_dir>] [--verbose]
-d <deadline_installer_uri>
-c <deadline_recipes_uri>


Arguments:
-r, --release <deadline_release_version>
Specifies the official release of Deadline that should be staged. This must be of the form 10.x.y.z.

-d, --deadlineInstallerURI <deadline_installer_uri>
Specifies a URI pointing to the Deadline Linux Client installer. This currently supports S3 URIs of the form:

Expand Down