2022-06-23 19:33:42 +00:00
|
|
|
import { nanoid } from '../dependencies.ts';
|
2022-06-07 21:59:34 +00:00
|
|
|
import AndroidVersioning from './android-versioning.ts';
|
|
|
|
|
import CloudRunnerConstants from './cloud-runner/services/cloud-runner-constants.ts';
|
|
|
|
|
import CloudRunnerBuildGuid from './cloud-runner/services/cloud-runner-guid.ts';
|
|
|
|
|
import Input from './input.ts';
|
|
|
|
|
import Platform from './platform.ts';
|
|
|
|
|
import UnityVersioning from './unity-versioning.ts';
|
|
|
|
|
import Versioning from './versioning.ts';
|
|
|
|
|
import { GitRepoReader } from './input-readers/git-repo.ts';
|
|
|
|
|
import { GithubCliReader } from './input-readers/github-cli.ts';
|
|
|
|
|
import { Cli } from './cli/cli.ts';
|
2022-08-12 21:45:43 +00:00
|
|
|
import { CommandInterface } from '../commands/command/command-interface.ts';
|
2022-08-13 00:51:26 +00:00
|
|
|
import { Environment } from '../core/env/environment.ts';
|
2020-01-20 23:06:14 +00:00
|
|
|
|
2022-08-07 23:51:36 +00:00
|
|
|
class Parameters {
|
2022-08-12 21:45:43 +00:00
|
|
|
private command: CommandInterface;
|
2022-04-03 15:59:14 +00:00
|
|
|
public editorVersion!: string;
|
2021-05-23 04:08:40 +00:00
|
|
|
public customImage!: string;
|
2022-01-25 21:18:15 +00:00
|
|
|
public unitySerial!: string;
|
2021-05-23 04:08:40 +00:00
|
|
|
public runnerTempPath: string | undefined;
|
2022-04-03 15:59:14 +00:00
|
|
|
public targetPlatform!: string;
|
2021-05-23 04:08:40 +00:00
|
|
|
public projectPath!: string;
|
|
|
|
|
public buildName!: string;
|
|
|
|
|
public buildPath!: string;
|
|
|
|
|
public buildFile!: string;
|
|
|
|
|
public buildMethod!: string;
|
|
|
|
|
public buildVersion!: string;
|
|
|
|
|
public androidVersionCode!: string;
|
|
|
|
|
public androidKeystoreName!: string;
|
|
|
|
|
public androidKeystoreBase64!: string;
|
|
|
|
|
public androidKeystorePass!: string;
|
|
|
|
|
public androidKeyaliasName!: string;
|
|
|
|
|
public androidKeyaliasPass!: string;
|
2021-11-24 12:51:52 +00:00
|
|
|
public androidTargetSdkVersion!: string;
|
|
|
|
|
public androidSdkManagerParameters!: string;
|
2021-05-23 04:08:40 +00:00
|
|
|
public customParameters!: string;
|
2021-05-28 21:51:10 +00:00
|
|
|
public sshAgent!: string;
|
2022-02-01 02:31:20 +00:00
|
|
|
public cloudRunnerCluster!: string;
|
|
|
|
|
public awsBaseStackName!: string;
|
2021-11-14 22:52:35 +00:00
|
|
|
public gitPrivateToken!: string;
|
2021-05-23 04:08:40 +00:00
|
|
|
public awsStackName!: string;
|
|
|
|
|
public kubeConfig!: string;
|
2022-02-01 02:31:20 +00:00
|
|
|
public cloudRunnerMemory!: string;
|
|
|
|
|
public cloudRunnerCpu!: string;
|
2021-05-23 04:08:40 +00:00
|
|
|
public kubeVolumeSize!: string;
|
|
|
|
|
public kubeVolume!: string;
|
Cloud Runner v0 - Reliable and trimmed down cloud runner (#353)
* Update cloud-runner-aws-pipeline.yml
* Update cloud-runner-k8s-pipeline.yml
* yarn build
* yarn build
* correct branch ref
* correct branch ref passed to target repo
* Create k8s-tests.yml
* Delete k8s-tests.yml
* correct branch ref passed to target repo
* correct branch ref passed to target repo
* Always describe AWS tasks for now, because unstable error handling
* Remove unused tree commands
* Use lfs guid sum
* Simple override cache push
* Simple override cache push and pull override to allow pure cloud storage driven caching
* Removal of early branch (breaks lfs caching)
* Remove unused tree commands
* Update action.yml
* Update action.yml
* Support cache and input override commands as input + full support custom hooks
* Increase k8s timeout
* replace filename being appended for unknclear reason
* cache key should not contain whitespaces
* Always try and deploy rook for k8s
* Apply k8s files for rook
* Update action.yml
* Apply k8s files for rook
* Apply k8s files for rook
* cache test and action description for kuber storage class
* Correct test and implement dependency health check and start
* GCP-secret run, cache key
* lfs smudge set explicit and undo explicit
* Run using external secret provider to speed up input
* Update cloud-runner-aws-pipeline.yml
* Add nodejs as build step dependency
* Add nodejs as build step dependency
* Cloud Runner Tests must be specified to capture logs from cloud runner for tests
* Cloud Runner Tests must be specified to capture logs from cloud runner for tests
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* better defaults for new inputs
* better defaults
* merge latest
* force build update
* use npm n to update node in unity builder
* use npm n to update node in unity builder
* use npm n to update node in unity builder
* correct new line
* quiet zipping
* quiet zipping
* default secrets for unity username and password
* default secrets for unity username and password
* ls active directory before lfs install
* Get cloud runner secrets from
* Get cloud runner secrets from
* Cleanup setup of default secrets
* Various fixes
* Cleanup setup of default secrets
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* AWS secrets manager support
* less caching logs
* default k8s storage class to pd-standard
* more readable build commands
* Capture aws exit code 1 reliably
* Always replace /head from branch
* k8s default storage class to standard-rwo
* cleanup
* further cleanup input
* further cleanup input
* further cleanup input
* further cleanup input
* further cleanup input
* folder sizes to inspect caching
* dir command for local cloud runner test
* k8s wait for pending because pvc will not create earlier
* prefer k8s standard storage
* handle empty string as cloud runner cluster input
* local-system is now used for cloud runner test implementation AND correctly unset test CLI input
* local-system is now used for cloud runner test implementation AND correctly unset test CLI input
* fix unterminated quote
* fix unterminated quote
* do not share build parameters in tests - in cloud runner this will cause conflicts with resouces of the same name
* remove head and heads from branch prefix
* fix reversed caching direction of cache-push
* fixes
* fixes
* fixes
* cachePull cli
* fixes
* fixes
* fixes
* fixes
* fixes
* order cache test to be first
* order cache test to be first
* fixes
* populate cache key instead of using branch
* cleanup cli
* garbage-collect-aws cli can iterate over aws resources and cli scans all ts files
* import cli methods
* import cli files explicitly
* import cli files explicitly
* import cli files explicitly
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* log parameters in cloud runner parameter test
* log parameters in cloud runner parameter test
* log parameters in cloud runner parameter test
* Cloud runner param test before caching because we have a fast local cache test now
* Using custom build path relative to repo root rather than project root
* aws-garbage-collect at end of pipeline
* aws-garbage-collect do not actually delete anything for now - just list
* remove some legacy du commands
* Update cloud-runner-aws-pipeline.yml
* log contents after cache pull and fix some scenarios with duplicate secrets
* log contents after cache pull and fix some scenarios with duplicate secrets
* log contents after cache pull and fix some scenarios with duplicate secrets
* PR comments
* Replace guid with uuid package
* use fileExists lambda instead of stat to check file exists in caching
* build failed results in core error message
* Delete sample.txt
2022-04-10 23:00:37 +00:00
|
|
|
public kubeStorageClass!: string;
|
2021-05-23 04:08:40 +00:00
|
|
|
public chownFilesTo!: string;
|
Cloud Runner v0 - Reliable and trimmed down cloud runner (#353)
* Update cloud-runner-aws-pipeline.yml
* Update cloud-runner-k8s-pipeline.yml
* yarn build
* yarn build
* correct branch ref
* correct branch ref passed to target repo
* Create k8s-tests.yml
* Delete k8s-tests.yml
* correct branch ref passed to target repo
* correct branch ref passed to target repo
* Always describe AWS tasks for now, because unstable error handling
* Remove unused tree commands
* Use lfs guid sum
* Simple override cache push
* Simple override cache push and pull override to allow pure cloud storage driven caching
* Removal of early branch (breaks lfs caching)
* Remove unused tree commands
* Update action.yml
* Update action.yml
* Support cache and input override commands as input + full support custom hooks
* Increase k8s timeout
* replace filename being appended for unknclear reason
* cache key should not contain whitespaces
* Always try and deploy rook for k8s
* Apply k8s files for rook
* Update action.yml
* Apply k8s files for rook
* Apply k8s files for rook
* cache test and action description for kuber storage class
* Correct test and implement dependency health check and start
* GCP-secret run, cache key
* lfs smudge set explicit and undo explicit
* Run using external secret provider to speed up input
* Update cloud-runner-aws-pipeline.yml
* Add nodejs as build step dependency
* Add nodejs as build step dependency
* Cloud Runner Tests must be specified to capture logs from cloud runner for tests
* Cloud Runner Tests must be specified to capture logs from cloud runner for tests
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* better defaults for new inputs
* better defaults
* merge latest
* force build update
* use npm n to update node in unity builder
* use npm n to update node in unity builder
* use npm n to update node in unity builder
* correct new line
* quiet zipping
* quiet zipping
* default secrets for unity username and password
* default secrets for unity username and password
* ls active directory before lfs install
* Get cloud runner secrets from
* Get cloud runner secrets from
* Cleanup setup of default secrets
* Various fixes
* Cleanup setup of default secrets
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* AWS secrets manager support
* less caching logs
* default k8s storage class to pd-standard
* more readable build commands
* Capture aws exit code 1 reliably
* Always replace /head from branch
* k8s default storage class to standard-rwo
* cleanup
* further cleanup input
* further cleanup input
* further cleanup input
* further cleanup input
* further cleanup input
* folder sizes to inspect caching
* dir command for local cloud runner test
* k8s wait for pending because pvc will not create earlier
* prefer k8s standard storage
* handle empty string as cloud runner cluster input
* local-system is now used for cloud runner test implementation AND correctly unset test CLI input
* local-system is now used for cloud runner test implementation AND correctly unset test CLI input
* fix unterminated quote
* fix unterminated quote
* do not share build parameters in tests - in cloud runner this will cause conflicts with resouces of the same name
* remove head and heads from branch prefix
* fix reversed caching direction of cache-push
* fixes
* fixes
* fixes
* cachePull cli
* fixes
* fixes
* fixes
* fixes
* fixes
* order cache test to be first
* order cache test to be first
* fixes
* populate cache key instead of using branch
* cleanup cli
* garbage-collect-aws cli can iterate over aws resources and cli scans all ts files
* import cli methods
* import cli files explicitly
* import cli files explicitly
* import cli files explicitly
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* log parameters in cloud runner parameter test
* log parameters in cloud runner parameter test
* log parameters in cloud runner parameter test
* Cloud runner param test before caching because we have a fast local cache test now
* Using custom build path relative to repo root rather than project root
* aws-garbage-collect at end of pipeline
* aws-garbage-collect do not actually delete anything for now - just list
* remove some legacy du commands
* Update cloud-runner-aws-pipeline.yml
* log contents after cache pull and fix some scenarios with duplicate secrets
* log contents after cache pull and fix some scenarios with duplicate secrets
* log contents after cache pull and fix some scenarios with duplicate secrets
* PR comments
* Replace guid with uuid package
* use fileExists lambda instead of stat to check file exists in caching
* build failed results in core error message
* Delete sample.txt
2022-04-10 23:00:37 +00:00
|
|
|
public customJobHooks!: string;
|
|
|
|
|
public cachePushOverrideCommand!: string;
|
|
|
|
|
public cachePullOverrideCommand!: string;
|
|
|
|
|
public readInputFromOverrideList!: string;
|
|
|
|
|
public readInputOverrideCommand!: string;
|
|
|
|
|
public checkDependencyHealthOverride!: string;
|
|
|
|
|
public startDependenciesOverride!: string;
|
|
|
|
|
public cacheKey!: string;
|
2022-02-01 02:31:20 +00:00
|
|
|
public postBuildSteps!: string;
|
|
|
|
|
public preBuildSteps!: string;
|
|
|
|
|
public customJob!: string;
|
|
|
|
|
public runNumber!: string;
|
|
|
|
|
public branch!: string;
|
|
|
|
|
public githubRepo!: string;
|
|
|
|
|
public gitSha!: string;
|
|
|
|
|
public logId!: string;
|
|
|
|
|
public buildGuid!: string;
|
Cloud Runner v0 - Reliable and trimmed down cloud runner (#353)
* Update cloud-runner-aws-pipeline.yml
* Update cloud-runner-k8s-pipeline.yml
* yarn build
* yarn build
* correct branch ref
* correct branch ref passed to target repo
* Create k8s-tests.yml
* Delete k8s-tests.yml
* correct branch ref passed to target repo
* correct branch ref passed to target repo
* Always describe AWS tasks for now, because unstable error handling
* Remove unused tree commands
* Use lfs guid sum
* Simple override cache push
* Simple override cache push and pull override to allow pure cloud storage driven caching
* Removal of early branch (breaks lfs caching)
* Remove unused tree commands
* Update action.yml
* Update action.yml
* Support cache and input override commands as input + full support custom hooks
* Increase k8s timeout
* replace filename being appended for unknclear reason
* cache key should not contain whitespaces
* Always try and deploy rook for k8s
* Apply k8s files for rook
* Update action.yml
* Apply k8s files for rook
* Apply k8s files for rook
* cache test and action description for kuber storage class
* Correct test and implement dependency health check and start
* GCP-secret run, cache key
* lfs smudge set explicit and undo explicit
* Run using external secret provider to speed up input
* Update cloud-runner-aws-pipeline.yml
* Add nodejs as build step dependency
* Add nodejs as build step dependency
* Cloud Runner Tests must be specified to capture logs from cloud runner for tests
* Cloud Runner Tests must be specified to capture logs from cloud runner for tests
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* Refactor and cleanup - no async input, combined setup/build, removed github logs for cli runs
* better defaults for new inputs
* better defaults
* merge latest
* force build update
* use npm n to update node in unity builder
* use npm n to update node in unity builder
* use npm n to update node in unity builder
* correct new line
* quiet zipping
* quiet zipping
* default secrets for unity username and password
* default secrets for unity username and password
* ls active directory before lfs install
* Get cloud runner secrets from
* Get cloud runner secrets from
* Cleanup setup of default secrets
* Various fixes
* Cleanup setup of default secrets
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* Various fixes
* AWS secrets manager support
* less caching logs
* default k8s storage class to pd-standard
* more readable build commands
* Capture aws exit code 1 reliably
* Always replace /head from branch
* k8s default storage class to standard-rwo
* cleanup
* further cleanup input
* further cleanup input
* further cleanup input
* further cleanup input
* further cleanup input
* folder sizes to inspect caching
* dir command for local cloud runner test
* k8s wait for pending because pvc will not create earlier
* prefer k8s standard storage
* handle empty string as cloud runner cluster input
* local-system is now used for cloud runner test implementation AND correctly unset test CLI input
* local-system is now used for cloud runner test implementation AND correctly unset test CLI input
* fix unterminated quote
* fix unterminated quote
* do not share build parameters in tests - in cloud runner this will cause conflicts with resouces of the same name
* remove head and heads from branch prefix
* fix reversed caching direction of cache-push
* fixes
* fixes
* fixes
* cachePull cli
* fixes
* fixes
* fixes
* fixes
* fixes
* order cache test to be first
* order cache test to be first
* fixes
* populate cache key instead of using branch
* cleanup cli
* garbage-collect-aws cli can iterate over aws resources and cli scans all ts files
* import cli methods
* import cli files explicitly
* import cli files explicitly
* import cli files explicitly
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* import cli methods
* log parameters in cloud runner parameter test
* log parameters in cloud runner parameter test
* log parameters in cloud runner parameter test
* Cloud runner param test before caching because we have a fast local cache test now
* Using custom build path relative to repo root rather than project root
* aws-garbage-collect at end of pipeline
* aws-garbage-collect do not actually delete anything for now - just list
* remove some legacy du commands
* Update cloud-runner-aws-pipeline.yml
* log contents after cache pull and fix some scenarios with duplicate secrets
* log contents after cache pull and fix some scenarios with duplicate secrets
* log contents after cache pull and fix some scenarios with duplicate secrets
* PR comments
* Replace guid with uuid package
* use fileExists lambda instead of stat to check file exists in caching
* build failed results in core error message
* Delete sample.txt
2022-04-10 23:00:37 +00:00
|
|
|
public cloudRunnerBranch!: string;
|
|
|
|
|
public cloudRunnerIntegrationTests!: boolean;
|
|
|
|
|
public cloudRunnerBuilderPlatform!: string | undefined;
|
|
|
|
|
public isCliMode!: boolean;
|
2022-02-01 02:31:20 +00:00
|
|
|
|
2022-08-09 21:53:46 +00:00
|
|
|
private readonly input: Input;
|
2022-08-13 00:51:26 +00:00
|
|
|
private readonly env: Environment;
|
2022-08-09 21:53:46 +00:00
|
|
|
|
2022-08-13 00:51:26 +00:00
|
|
|
constructor(input: Input, env: Environment) {
|
2022-08-07 23:51:36 +00:00
|
|
|
this.input = input;
|
2022-08-09 21:53:46 +00:00
|
|
|
this.env = env;
|
2022-08-07 23:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async parse(): Promise<Parameters> {
|
|
|
|
|
const buildFile = Parameters.parseBuildFile(
|
|
|
|
|
this.input.buildName,
|
|
|
|
|
this.input.targetPlatform,
|
|
|
|
|
this.input.androidAppBundle,
|
|
|
|
|
);
|
2022-08-06 17:51:21 +00:00
|
|
|
log.debug('buildFile:', buildFile);
|
2022-08-07 23:51:36 +00:00
|
|
|
const editorVersion = UnityVersioning.determineUnityVersion(this.input.projectPath, this.input.unityVersion);
|
2022-08-20 19:34:41 +00:00
|
|
|
log.info('Detected editorVersion', editorVersion);
|
2022-08-07 23:51:36 +00:00
|
|
|
const buildVersion = await Versioning.determineBuildVersion(
|
|
|
|
|
this.input.versioningStrategy,
|
|
|
|
|
this.input.specifiedVersion,
|
|
|
|
|
this.input.allowDirtyBuild,
|
|
|
|
|
);
|
2022-08-06 17:51:21 +00:00
|
|
|
log.debug('buildVersion', buildVersion);
|
2022-08-07 23:51:36 +00:00
|
|
|
const androidVersionCode = AndroidVersioning.determineVersionCode(buildVersion, this.input.androidVersionCode);
|
2022-08-06 17:51:21 +00:00
|
|
|
log.debug('androidVersionCode', androidVersionCode);
|
2022-08-07 23:51:36 +00:00
|
|
|
const androidSdkManagerParameters = AndroidVersioning.determineSdkManagerParameters(
|
|
|
|
|
this.input.androidTargetSdkVersion,
|
|
|
|
|
);
|
2022-08-06 17:51:21 +00:00
|
|
|
log.debug('androidSdkManagerParameters', androidSdkManagerParameters);
|
2021-11-24 12:51:52 +00:00
|
|
|
|
2022-01-25 21:18:15 +00:00
|
|
|
let unitySerial = '';
|
2022-08-12 21:45:43 +00:00
|
|
|
if (!this.env.UNITY_SERIAL && this.input.githubInputEnabled) {
|
2022-04-11 22:43:41 +00:00
|
|
|
// No serial was present, so it is a personal license that we need to convert
|
2022-08-12 21:45:43 +00:00
|
|
|
if (!this.env.UNITY_LICENSE) {
|
2022-01-25 21:18:15 +00:00
|
|
|
throw new Error(`Missing Unity License File and no Serial was found. If this
|
|
|
|
|
is a personal license, make sure to follow the activation
|
|
|
|
|
steps and set the UNITY_LICENSE GitHub secret or enter a Unity
|
|
|
|
|
serial number inside the UNITY_SERIAL GitHub secret.`);
|
|
|
|
|
}
|
2022-08-12 21:45:43 +00:00
|
|
|
unitySerial = this.getSerialFromLicenseFile(this.env.UNITY_LICENSE);
|
2022-01-25 21:18:15 +00:00
|
|
|
} else {
|
2022-08-12 21:45:43 +00:00
|
|
|
unitySerial = this.env.UNITY_SERIAL!;
|
2022-01-25 21:18:15 +00:00
|
|
|
}
|
|
|
|
|
|
2022-08-20 16:12:43 +00:00
|
|
|
const branch = (await Versioning.getCurrentBranch()) || (await GitRepoReader.GetBranch());
|
|
|
|
|
log.info(`branch: "${branch}"`);
|
|
|
|
|
|
|
|
|
|
const projectPath = this.input.projectPath;
|
|
|
|
|
log.info(`projectPath: "${projectPath}"`);
|
|
|
|
|
|
|
|
|
|
const targetPlatform = this.input.targetPlatform;
|
|
|
|
|
log.info(`targetPlatform: "${targetPlatform}"`);
|
|
|
|
|
|
2022-08-12 21:45:43 +00:00
|
|
|
const parameters = {
|
2022-04-03 15:59:14 +00:00
|
|
|
editorVersion,
|
2022-08-07 23:51:36 +00:00
|
|
|
customImage: this.input.customImage,
|
2022-01-25 21:18:15 +00:00
|
|
|
unitySerial,
|
2022-08-12 21:45:43 +00:00
|
|
|
runnerTempPath: this.env.RUNNER_TEMP,
|
2022-08-20 16:12:43 +00:00
|
|
|
targetPlatform,
|
|
|
|
|
projectPath,
|
2022-08-07 23:51:36 +00:00
|
|
|
buildName: this.input.buildName,
|
|
|
|
|
buildPath: `${this.input.buildsPath}/${this.input.targetPlatform}`,
|
2020-05-21 15:44:56 +00:00
|
|
|
buildFile,
|
2022-08-07 23:51:36 +00:00
|
|
|
buildMethod: this.input.buildMethod,
|
2020-04-26 18:22:09 +00:00
|
|
|
buildVersion,
|
2020-06-24 22:02:05 +00:00
|
|
|
androidVersionCode,
|
2022-08-07 23:51:36 +00:00
|
|
|
androidKeystoreName: this.input.androidKeystoreName,
|
|
|
|
|
androidKeystoreBase64: this.input.androidKeystoreBase64,
|
|
|
|
|
androidKeystorePass: this.input.androidKeystorePass,
|
|
|
|
|
androidKeyaliasName: this.input.androidKeyaliasName,
|
|
|
|
|
androidKeyaliasPass: this.input.androidKeyaliasPass,
|
|
|
|
|
androidTargetSdkVersion: this.input.androidTargetSdkVersion,
|
2021-11-24 12:51:52 +00:00
|
|
|
androidSdkManagerParameters,
|
2022-08-07 23:51:36 +00:00
|
|
|
customParameters: this.input.customParameters,
|
|
|
|
|
sshAgent: this.input.sshAgent,
|
2022-08-20 16:12:43 +00:00
|
|
|
gitPrivateToken: this.input.gitPrivateToken,
|
2022-08-07 23:51:36 +00:00
|
|
|
chownFilesTo: this.input.chownFilesTo,
|
|
|
|
|
customJob: this.input.customJob,
|
2022-08-20 16:12:43 +00:00
|
|
|
branch,
|
2020-01-20 23:06:14 +00:00
|
|
|
};
|
2022-08-12 21:45:43 +00:00
|
|
|
|
2022-08-20 16:12:43 +00:00
|
|
|
const commandParameterOverrides = await this.command.parseParameters(this.input, parameters);
|
2022-08-12 21:45:43 +00:00
|
|
|
|
|
|
|
|
// Todo - Maybe return an instance instead
|
|
|
|
|
return {
|
|
|
|
|
...parameters,
|
|
|
|
|
...commandParameterOverrides,
|
|
|
|
|
};
|
2020-01-20 23:06:14 +00:00
|
|
|
}
|
|
|
|
|
|
2020-07-06 01:41:21 +00:00
|
|
|
static parseBuildFile(filename, platform, androidAppBundle) {
|
2020-01-20 23:06:14 +00:00
|
|
|
if (Platform.isWindows(platform)) {
|
|
|
|
|
return `${filename}.exe`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Platform.isAndroid(platform)) {
|
2020-07-06 01:41:21 +00:00
|
|
|
return androidAppBundle ? `${filename}.aab` : `${filename}.apk`;
|
2020-01-20 23:06:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return filename;
|
|
|
|
|
}
|
2022-01-25 21:18:15 +00:00
|
|
|
|
|
|
|
|
static getSerialFromLicenseFile(license) {
|
|
|
|
|
const startKey = `<DeveloperData Value="`;
|
|
|
|
|
const endKey = `"/>`;
|
|
|
|
|
const startIndex = license.indexOf(startKey) + startKey.length;
|
|
|
|
|
if (startIndex < 0) {
|
|
|
|
|
throw new Error(`License File was corrupted, unable to locate serial`);
|
|
|
|
|
}
|
|
|
|
|
const endIndex = license.indexOf(endKey, startIndex);
|
2022-04-11 22:43:41 +00:00
|
|
|
|
2022-01-25 21:18:15 +00:00
|
|
|
// Slice off the first 4 characters as they are garbage values
|
|
|
|
|
return Buffer.from(license.slice(startIndex, endIndex), 'base64').toString('binary').slice(4);
|
|
|
|
|
}
|
2022-08-12 21:45:43 +00:00
|
|
|
|
|
|
|
|
registerCommand(command: CommandInterface) {
|
|
|
|
|
this.command = command;
|
|
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
}
|
2020-01-20 23:06:14 +00:00
|
|
|
}
|
|
|
|
|
|
2022-08-07 23:51:36 +00:00
|
|
|
export default Parameters;
|