fix
							parent
							
								
									1752c28269
								
							
						
					
					
						commit
						eca0bd0778
					
				|  | @ -392,6 +392,7 @@ const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); | ||||||
| class CLI { | class CLI { | ||||||
|     static RunCli(options) { |     static RunCli(options) { | ||||||
|         return __awaiter(this, void 0, void 0, function* () { |         return __awaiter(this, void 0, void 0, function* () { | ||||||
|  |             __1.Input.githubInputEnabled = false; | ||||||
|             const container = new Array(); |             const container = new Array(); | ||||||
|             container.push({ |             container.push({ | ||||||
|                 key: `remote-cli`, |                 key: `remote-cli`, | ||||||
|  | @ -2650,15 +2651,19 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); | ||||||
| exports.CloudRunnerState = void 0; | exports.CloudRunnerState = void 0; | ||||||
| const path_1 = __importDefault(__webpack_require__(85622)); | const path_1 = __importDefault(__webpack_require__(85622)); | ||||||
| class CloudRunnerState { | class CloudRunnerState { | ||||||
|  |     // only the following paths that do not start a path.join with another "Full" suffixed property need to start with an absolute /
 | ||||||
|  |     static get buildPathFull() { | ||||||
|  |         return path_1.default.join(`/`, CloudRunnerState.buildVolumeFolder, CloudRunnerState.buildParams.buildGuid); | ||||||
|  |     } | ||||||
|  |     static get cacheFolderFull() { | ||||||
|  |         return path_1.default.join('/', CloudRunnerState.buildVolumeFolder, CloudRunnerState.cacheFolder, CloudRunnerState.branchName); | ||||||
|  |     } | ||||||
|     static setup(buildParameters) { |     static setup(buildParameters) { | ||||||
|         CloudRunnerState.buildParams = buildParameters; |         CloudRunnerState.buildParams = buildParameters; | ||||||
|     } |     } | ||||||
|     static get branchName() { |     static get branchName() { | ||||||
|         return CloudRunnerState.buildParams.branch; |         return CloudRunnerState.buildParams.branch; | ||||||
|     } |     } | ||||||
|     static get buildPathFull() { |  | ||||||
|         return path_1.default.join(`/`, CloudRunnerState.buildVolumeFolder, CloudRunnerState.buildParams.buildGuid); |  | ||||||
|     } |  | ||||||
|     static get builderPathFull() { |     static get builderPathFull() { | ||||||
|         return path_1.default.join(CloudRunnerState.buildPathFull, `builder`); |         return path_1.default.join(CloudRunnerState.buildPathFull, `builder`); | ||||||
|     } |     } | ||||||
|  | @ -2671,9 +2676,6 @@ class CloudRunnerState { | ||||||
|     static get libraryFolderFull() { |     static get libraryFolderFull() { | ||||||
|         return path_1.default.join(CloudRunnerState.projectPathFull, `Library`); |         return path_1.default.join(CloudRunnerState.projectPathFull, `Library`); | ||||||
|     } |     } | ||||||
|     static get cacheFolderFull() { |  | ||||||
|         return path_1.default.join('/', CloudRunnerState.buildVolumeFolder, CloudRunnerState.cacheFolder, CloudRunnerState.branchName); |  | ||||||
|     } |  | ||||||
|     static get lfsDirectory() { |     static get lfsDirectory() { | ||||||
|         return path_1.default.join(CloudRunnerState.repoPathFull, `.git`, `lfs`); |         return path_1.default.join(CloudRunnerState.repoPathFull, `.git`, `lfs`); | ||||||
|     } |     } | ||||||
|  | @ -2767,7 +2769,7 @@ class BuildStep { | ||||||
|         cp -r "${path_1.default |         cp -r "${path_1.default | ||||||
|                 .join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'entrypoint.sh') |                 .join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'entrypoint.sh') | ||||||
|                 .replace(/\\/g, `/`)}" "/entrypoint.sh" |                 .replace(/\\/g, `/`)}" "/entrypoint.sh" | ||||||
|         cp -r "${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', '').replace(/\\/g, `/`)}/dist/steps/" "/steps" |         cp -r "${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', 'steps').replace(/\\/g, `/`)}" "/steps" | ||||||
|         chmod -R +x "/entrypoint.sh" |         chmod -R +x "/entrypoint.sh" | ||||||
|         chmod -R +x "/steps" |         chmod -R +x "/steps" | ||||||
|         /entrypoint.sh |         /entrypoint.sh | ||||||
|  | @ -3501,20 +3503,21 @@ const core = __webpack_require__(42186); | ||||||
|  * Note that input is always passed as a string, even booleans. |  * Note that input is always passed as a string, even booleans. | ||||||
|  */ |  */ | ||||||
| class Input { | class Input { | ||||||
|  |     // also enabled debug logging for cloud runner
 | ||||||
|     static get cloudRunnerTests() { |     static get cloudRunnerTests() { | ||||||
|         return Input.getInput(`cloudRunnerTests`) || Input.getInput(`CloudRunnerTests`) || false; |         return Input.getInput(`cloudRunnerTests`) || Input.getInput(`CloudRunnerTests`) || false; | ||||||
|     } |     } | ||||||
|     static getInput(query) { |     static getInput(query) { | ||||||
|         const coreInput = core.getInput(query); |         if (Input.githubInputEnabled) { | ||||||
|         return coreInput && coreInput !== '' |             return core.getInput(query) || ''; | ||||||
|             ? coreInput |         } | ||||||
|             : Input.cliOptions !== undefined && Input.cliOptions[query] !== undefined |         return Input.cliOptions !== undefined && Input.cliOptions[query] !== undefined | ||||||
|                 ? Input.cliOptions[query] |             ? Input.cliOptions[query] | ||||||
|                 : process.env[query] !== undefined |             : process.env[query] !== undefined | ||||||
|                     ? process.env[query] |                 ? process.env[query] | ||||||
|                     : process.env[Input.ToEnvVarFormat(query)] |                 : process.env[Input.ToEnvVarFormat(query)] | ||||||
|                         ? process.env[Input.ToEnvVarFormat(query)] |                     ? process.env[Input.ToEnvVarFormat(query)] | ||||||
|                         : ''; |                     : ''; | ||||||
|     } |     } | ||||||
|     static get region() { |     static get region() { | ||||||
|         return Input.getInput('region') || 'eu-west-2'; |         return Input.getInput('region') || 'eu-west-2'; | ||||||
|  | @ -3677,6 +3680,7 @@ class Input { | ||||||
|             .replace(/ /g, '_'); |             .replace(/ /g, '_'); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | Input.githubInputEnabled = true; | ||||||
| exports.default = Input; | exports.default = Input; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -6,6 +6,7 @@ import { ActionYamlReader } from '../input-readers/action-yaml'; | ||||||
| import CloudRunnerLogger from '../cloud-runner/services/cloud-runner-logger'; | import CloudRunnerLogger from '../cloud-runner/services/cloud-runner-logger'; | ||||||
| export class CLI { | export class CLI { | ||||||
|   static async RunCli(options: any): Promise<void> { |   static async RunCli(options: any): Promise<void> { | ||||||
|  |     Input.githubInputEnabled = false; | ||||||
|     const container = new Array(); |     const container = new Array(); | ||||||
|     container.push( |     container.push( | ||||||
|       { |       { | ||||||
|  |  | ||||||
|  | @ -26,6 +26,7 @@ describe('Cloud Runner', () => { | ||||||
|   }; |   }; | ||||||
|   if (Input.cloudRunnerTests) { |   if (Input.cloudRunnerTests) { | ||||||
|     it('All build parameters sent to cloud runner as env vars', async () => { |     it('All build parameters sent to cloud runner as env vars', async () => { | ||||||
|  |       Input.githubInputEnabled = false; | ||||||
|       const buildParameter = await BuildParameters.create(); |       const buildParameter = await BuildParameters.create(); | ||||||
|       const baseImage = new ImageTag(buildParameter); |       const baseImage = new ImageTag(buildParameter); | ||||||
|       const file = await CloudRunner.run(buildParameter, baseImage.toString()); |       const file = await CloudRunner.run(buildParameter, baseImage.toString()); | ||||||
|  |  | ||||||
|  | @ -9,6 +9,21 @@ export class CloudRunnerState { | ||||||
|   public static defaultSecrets: CloudRunnerSecret[]; |   public static defaultSecrets: CloudRunnerSecret[]; | ||||||
|   public static readonly repositoryFolder = 'repo'; |   public static readonly repositoryFolder = 'repo'; | ||||||
| 
 | 
 | ||||||
|  |   // only the following paths that do not start a path.join with another "Full" suffixed property need to start with an absolute /
 | ||||||
|  | 
 | ||||||
|  |   public static get buildPathFull(): string { | ||||||
|  |     return path.join(`/`, CloudRunnerState.buildVolumeFolder, CloudRunnerState.buildParams.buildGuid); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   public static get cacheFolderFull(): string { | ||||||
|  |     return path.join( | ||||||
|  |       '/', | ||||||
|  |       CloudRunnerState.buildVolumeFolder, | ||||||
|  |       CloudRunnerState.cacheFolder, | ||||||
|  |       CloudRunnerState.branchName, | ||||||
|  |     ); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   static setup(buildParameters: BuildParameters) { |   static setup(buildParameters: BuildParameters) { | ||||||
|     CloudRunnerState.buildParams = buildParameters; |     CloudRunnerState.buildParams = buildParameters; | ||||||
|   } |   } | ||||||
|  | @ -16,11 +31,6 @@ export class CloudRunnerState { | ||||||
|   public static get branchName(): string { |   public static get branchName(): string { | ||||||
|     return CloudRunnerState.buildParams.branch; |     return CloudRunnerState.buildParams.branch; | ||||||
|   } |   } | ||||||
| 
 |  | ||||||
|   public static get buildPathFull(): string { |  | ||||||
|     return path.join(`/`, CloudRunnerState.buildVolumeFolder, CloudRunnerState.buildParams.buildGuid); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   public static get builderPathFull(): string { |   public static get builderPathFull(): string { | ||||||
|     return path.join(CloudRunnerState.buildPathFull, `builder`); |     return path.join(CloudRunnerState.buildPathFull, `builder`); | ||||||
|   } |   } | ||||||
|  | @ -37,15 +47,6 @@ export class CloudRunnerState { | ||||||
|     return path.join(CloudRunnerState.projectPathFull, `Library`); |     return path.join(CloudRunnerState.projectPathFull, `Library`); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   public static get cacheFolderFull(): string { |  | ||||||
|     return path.join( |  | ||||||
|       '/', |  | ||||||
|       CloudRunnerState.buildVolumeFolder, |  | ||||||
|       CloudRunnerState.cacheFolder, |  | ||||||
|       CloudRunnerState.branchName, |  | ||||||
|     ); |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   public static get lfsDirectory(): string { |   public static get lfsDirectory(): string { | ||||||
|     return path.join(CloudRunnerState.repoPathFull, `.git`, `lfs`); |     return path.join(CloudRunnerState.repoPathFull, `.git`, `lfs`); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | @ -33,7 +33,7 @@ export class BuildStep implements StepInterface { | ||||||
|         cp -r "${path |         cp -r "${path | ||||||
|           .join(CloudRunnerState.builderPathFull, 'dist', 'entrypoint.sh') |           .join(CloudRunnerState.builderPathFull, 'dist', 'entrypoint.sh') | ||||||
|           .replace(/\\/g, `/`)}" "/entrypoint.sh" |           .replace(/\\/g, `/`)}" "/entrypoint.sh" | ||||||
|         cp -r "${path.join(CloudRunnerState.builderPathFull, 'dist', '').replace(/\\/g, `/`)}/dist/steps/" "/steps" |         cp -r "${path.join(CloudRunnerState.builderPathFull, 'dist', 'steps').replace(/\\/g, `/`)}" "/steps" | ||||||
|         chmod -R +x "/entrypoint.sh" |         chmod -R +x "/entrypoint.sh" | ||||||
|         chmod -R +x "/steps" |         chmod -R +x "/steps" | ||||||
|         /entrypoint.sh |         /entrypoint.sh | ||||||
|  |  | ||||||
|  | @ -13,14 +13,18 @@ const core = require('@actions/core'); | ||||||
|  */ |  */ | ||||||
| class Input { | class Input { | ||||||
|   public static cliOptions; |   public static cliOptions; | ||||||
|  |   public static githubInputEnabled: boolean = true; | ||||||
|  | 
 | ||||||
|  |   // also enabled debug logging for cloud runner
 | ||||||
|   static get cloudRunnerTests(): boolean { |   static get cloudRunnerTests(): boolean { | ||||||
|     return Input.getInput(`cloudRunnerTests`) || Input.getInput(`CloudRunnerTests`) || false; |     return Input.getInput(`cloudRunnerTests`) || Input.getInput(`CloudRunnerTests`) || false; | ||||||
|   } |   } | ||||||
|   private static getInput(query) { |   private static getInput(query) { | ||||||
|     const coreInput = core.getInput(query); |     if (Input.githubInputEnabled) { | ||||||
|     return coreInput && coreInput !== '' |       return core.getInput(query) || ''; | ||||||
|       ? coreInput |     } | ||||||
|       : Input.cliOptions !== undefined && Input.cliOptions[query] !== undefined | 
 | ||||||
|  |     return Input.cliOptions !== undefined && Input.cliOptions[query] !== undefined | ||||||
|       ? Input.cliOptions[query] |       ? Input.cliOptions[query] | ||||||
|       : process.env[query] !== undefined |       : process.env[query] !== undefined | ||||||
|       ? process.env[query] |       ? process.env[query] | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue