mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-02-02 22:59:06 +08:00
integrate PR #686
This commit is contained in:
@@ -84,6 +84,8 @@ class BuildParameters {
|
||||
public runNumber!: string;
|
||||
public branch!: string;
|
||||
public githubRepo!: string;
|
||||
public cloudRunnerRepoName!: string;
|
||||
public cloneDepth!: number;
|
||||
public gitSha!: string;
|
||||
public logId!: string;
|
||||
public buildGuid!: string;
|
||||
@@ -206,7 +208,9 @@ class BuildParameters {
|
||||
branch: Input.branch.replace('/head', '') || (await GitRepoReader.GetBranch()),
|
||||
cloudRunnerBranch: CloudRunnerOptions.cloudRunnerBranch.split('/').reverse()[0],
|
||||
cloudRunnerDebug: CloudRunnerOptions.cloudRunnerDebug,
|
||||
githubRepo: (Input.githubRepo ?? (await GitRepoReader.GetRemote())) || 'game-ci/unity-builder',
|
||||
githubRepo: (Input.githubRepo ?? (await GitRepoReader.GetRemote())) || CloudRunnerOptions.cloudRunnerRepoName,
|
||||
cloudRunnerRepoName: CloudRunnerOptions.cloudRunnerRepoName,
|
||||
cloneDepth: Number.parseInt(CloudRunnerOptions.cloneDepth),
|
||||
isCliMode: Cli.isCliMode,
|
||||
awsStackName: CloudRunnerOptions.awsStackName,
|
||||
awsEndpoint: CloudRunnerOptions.awsEndpoint,
|
||||
|
||||
@@ -73,7 +73,7 @@ export class CloudRunnerFolders {
|
||||
}
|
||||
|
||||
public static get unityBuilderRepoUrl(): string {
|
||||
return `https://${CloudRunner.buildParameters.gitPrivateToken}@github.com/game-ci/unity-builder.git`;
|
||||
return `https://${CloudRunner.buildParameters.gitPrivateToken}@github.com/${CloudRunner.buildParameters.cloudRunnerRepoName}.git`;
|
||||
}
|
||||
|
||||
public static get targetBuildRepoUrl(): string {
|
||||
|
||||
@@ -74,6 +74,14 @@ class CloudRunnerOptions {
|
||||
return CloudRunnerOptions.getInput('githubRepoName') || CloudRunnerOptions.githubRepo?.split(`/`)[1] || '';
|
||||
}
|
||||
|
||||
static get cloudRunnerRepoName(): string {
|
||||
return CloudRunnerOptions.getInput('cloudRunnerRepoName') || 'game-ci/unity-builder';
|
||||
}
|
||||
|
||||
static get cloneDepth(): string {
|
||||
return CloudRunnerOptions.getInput('cloneDepth') || '50';
|
||||
}
|
||||
|
||||
static get finalHooks(): string[] {
|
||||
return CloudRunnerOptions.getInput('finalHooks')?.split(',') || [];
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ export class AWSCloudFormationTemplates {
|
||||
|
||||
public static getSecretDefinitionTemplate(p1: string, p2: string) {
|
||||
return `
|
||||
Secrets:
|
||||
- Name: '${p1}'
|
||||
ValueFrom: !Ref ${p2}Secret
|
||||
`;
|
||||
|
||||
@@ -127,8 +127,7 @@ Resources:
|
||||
- SourceVolume: efs-data
|
||||
ContainerPath: !Ref EFSMountDirectory
|
||||
ReadOnly: false
|
||||
Secrets:
|
||||
# template secrets p3 - container def
|
||||
# template secrets p3 - container def
|
||||
LogConfiguration:
|
||||
LogDriver: awslogs
|
||||
Options:
|
||||
|
||||
@@ -306,8 +306,9 @@ export class RemoteClient {
|
||||
await CloudRunnerSystem.Run(`git config --global filter.lfs.smudge "git-lfs smudge --skip -- %f"`);
|
||||
await CloudRunnerSystem.Run(`git config --global filter.lfs.process "git-lfs filter-process --skip"`);
|
||||
try {
|
||||
const depthArg = CloudRunnerOptions.cloneDepth !== '0' ? `--depth ${CloudRunnerOptions.cloneDepth}` : '';
|
||||
await CloudRunnerSystem.Run(
|
||||
`git clone ${CloudRunnerFolders.targetBuildRepoUrl} ${path.basename(CloudRunnerFolders.repoPathAbsolute)}`,
|
||||
`git clone ${depthArg} ${CloudRunnerFolders.targetBuildRepoUrl} ${path.basename(CloudRunnerFolders.repoPathAbsolute)}`.trim(),
|
||||
);
|
||||
} catch (error: any) {
|
||||
throw error;
|
||||
|
||||
@@ -6,7 +6,7 @@ class ImageTag {
|
||||
public targetPlatform: string;
|
||||
public builderPlatform: string;
|
||||
public customImage: string;
|
||||
public imageRollingVersion: number;
|
||||
public imageRollingVersion: string;
|
||||
public imagePlatformPrefix: string;
|
||||
|
||||
constructor(imageProperties: { [key: string]: string }) {
|
||||
@@ -38,7 +38,7 @@ class ImageTag {
|
||||
providerStrategy,
|
||||
);
|
||||
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(buildPlatform);
|
||||
this.imageRollingVersion = Number(containerRegistryImageVersion); // Will automatically roll to the latest non-breaking version.
|
||||
this.imageRollingVersion = containerRegistryImageVersion; // Will automatically roll to the latest non-breaking version.
|
||||
}
|
||||
|
||||
static get versionPattern(): RegExp {
|
||||
|
||||
Reference in New Issue
Block a user