fix
							parent
							
								
									1752c28269
								
							
						
					
					
						commit
						eca0bd0778
					
				|  | @ -392,6 +392,7 @@ const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855)); | |||
| class CLI { | ||||
|     static RunCli(options) { | ||||
|         return __awaiter(this, void 0, void 0, function* () { | ||||
|             __1.Input.githubInputEnabled = false; | ||||
|             const container = new Array(); | ||||
|             container.push({ | ||||
|                 key: `remote-cli`, | ||||
|  | @ -2650,15 +2651,19 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); | |||
| exports.CloudRunnerState = void 0; | ||||
| const path_1 = __importDefault(__webpack_require__(85622)); | ||||
| 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) { | ||||
|         CloudRunnerState.buildParams = buildParameters; | ||||
|     } | ||||
|     static get branchName() { | ||||
|         return CloudRunnerState.buildParams.branch; | ||||
|     } | ||||
|     static get buildPathFull() { | ||||
|         return path_1.default.join(`/`, CloudRunnerState.buildVolumeFolder, CloudRunnerState.buildParams.buildGuid); | ||||
|     } | ||||
|     static get builderPathFull() { | ||||
|         return path_1.default.join(CloudRunnerState.buildPathFull, `builder`); | ||||
|     } | ||||
|  | @ -2671,9 +2676,6 @@ class CloudRunnerState { | |||
|     static get libraryFolderFull() { | ||||
|         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() { | ||||
|         return path_1.default.join(CloudRunnerState.repoPathFull, `.git`, `lfs`); | ||||
|     } | ||||
|  | @ -2767,7 +2769,7 @@ class BuildStep { | |||
|         cp -r "${path_1.default | ||||
|                 .join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', '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 "/steps" | ||||
|         /entrypoint.sh | ||||
|  | @ -3501,14 +3503,15 @@ const core = __webpack_require__(42186); | |||
|  * Note that input is always passed as a string, even booleans. | ||||
|  */ | ||||
| class Input { | ||||
|     // also enabled debug logging for cloud runner
 | ||||
|     static get cloudRunnerTests() { | ||||
|         return Input.getInput(`cloudRunnerTests`) || Input.getInput(`CloudRunnerTests`) || false; | ||||
|     } | ||||
|     static getInput(query) { | ||||
|         const coreInput = core.getInput(query); | ||||
|         return coreInput && coreInput !== '' | ||||
|             ? coreInput | ||||
|             : Input.cliOptions !== undefined && Input.cliOptions[query] !== undefined | ||||
|         if (Input.githubInputEnabled) { | ||||
|             return core.getInput(query) || ''; | ||||
|         } | ||||
|         return Input.cliOptions !== undefined && Input.cliOptions[query] !== undefined | ||||
|             ? Input.cliOptions[query] | ||||
|             : process.env[query] !== undefined | ||||
|                 ? process.env[query] | ||||
|  | @ -3677,6 +3680,7 @@ class Input { | |||
|             .replace(/ /g, '_'); | ||||
|     } | ||||
| } | ||||
| Input.githubInputEnabled = true; | ||||
| 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'; | ||||
| export class CLI { | ||||
|   static async RunCli(options: any): Promise<void> { | ||||
|     Input.githubInputEnabled = false; | ||||
|     const container = new Array(); | ||||
|     container.push( | ||||
|       { | ||||
|  |  | |||
|  | @ -26,6 +26,7 @@ describe('Cloud Runner', () => { | |||
|   }; | ||||
|   if (Input.cloudRunnerTests) { | ||||
|     it('All build parameters sent to cloud runner as env vars', async () => { | ||||
|       Input.githubInputEnabled = false; | ||||
|       const buildParameter = await BuildParameters.create(); | ||||
|       const baseImage = new ImageTag(buildParameter); | ||||
|       const file = await CloudRunner.run(buildParameter, baseImage.toString()); | ||||
|  |  | |||
|  | @ -9,6 +9,21 @@ export class CloudRunnerState { | |||
|   public static defaultSecrets: CloudRunnerSecret[]; | ||||
|   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) { | ||||
|     CloudRunnerState.buildParams = buildParameters; | ||||
|   } | ||||
|  | @ -16,11 +31,6 @@ export class CloudRunnerState { | |||
|   public static get branchName(): string { | ||||
|     return CloudRunnerState.buildParams.branch; | ||||
|   } | ||||
| 
 | ||||
|   public static get buildPathFull(): string { | ||||
|     return path.join(`/`, CloudRunnerState.buildVolumeFolder, CloudRunnerState.buildParams.buildGuid); | ||||
|   } | ||||
| 
 | ||||
|   public static get builderPathFull(): string { | ||||
|     return path.join(CloudRunnerState.buildPathFull, `builder`); | ||||
|   } | ||||
|  | @ -37,15 +47,6 @@ export class CloudRunnerState { | |||
|     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 { | ||||
|     return path.join(CloudRunnerState.repoPathFull, `.git`, `lfs`); | ||||
|   } | ||||
|  |  | |||
|  | @ -33,7 +33,7 @@ export class BuildStep implements StepInterface { | |||
|         cp -r "${path | ||||
|           .join(CloudRunnerState.builderPathFull, 'dist', '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 "/steps" | ||||
|         /entrypoint.sh | ||||
|  |  | |||
|  | @ -13,14 +13,18 @@ const core = require('@actions/core'); | |||
|  */ | ||||
| class Input { | ||||
|   public static cliOptions; | ||||
|   public static githubInputEnabled: boolean = true; | ||||
| 
 | ||||
|   // also enabled debug logging for cloud runner
 | ||||
|   static get cloudRunnerTests(): boolean { | ||||
|     return Input.getInput(`cloudRunnerTests`) || Input.getInput(`CloudRunnerTests`) || false; | ||||
|   } | ||||
|   private static getInput(query) { | ||||
|     const coreInput = core.getInput(query); | ||||
|     return coreInput && coreInput !== '' | ||||
|       ? coreInput | ||||
|       : Input.cliOptions !== undefined && Input.cliOptions[query] !== undefined | ||||
|     if (Input.githubInputEnabled) { | ||||
|       return core.getInput(query) || ''; | ||||
|     } | ||||
| 
 | ||||
|     return Input.cliOptions !== undefined && Input.cliOptions[query] !== undefined | ||||
|       ? Input.cliOptions[query] | ||||
|       : process.env[query] !== undefined | ||||
|       ? process.env[query] | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue