fix push to cache
parent
f226bef5af
commit
01ccc8ee10
|
|
@ -573,6 +573,48 @@ __decorate([
|
|||
exports.Cli = Cli;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 67170:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.SharedWorkspaceLocking = void 0;
|
||||
class SharedWorkspaceLocking {
|
||||
static GetLockedWorkspace() {
|
||||
const workspaces = SharedWorkspaceLocking.GetFreeWorkspaces();
|
||||
for (const element of workspaces) {
|
||||
if (SharedWorkspaceLocking.LockWorkspace(element)) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
static GetFreeWorkspaces() {
|
||||
return [];
|
||||
}
|
||||
static GetAllWorkspaces() {
|
||||
return [];
|
||||
}
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
static LockWorkspace(workspace) {
|
||||
return true;
|
||||
}
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
static IsWorkspaceLocked(workspace) { }
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
static HasWorkspaceLock(workspace) { }
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
static CreateLockableWorkspace(workspace, locked = false) { }
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
static ReleaseLock(workspace) { }
|
||||
}
|
||||
exports.SharedWorkspaceLocking = SharedWorkspaceLocking;
|
||||
exports["default"] = SharedWorkspaceLocking;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 96552:
|
||||
|
|
@ -4409,11 +4451,10 @@ class FollowLogStreamService {
|
|||
shouldCleanup = false;
|
||||
core.warning('cloud runner stop watching');
|
||||
}
|
||||
message = `[${cloud_runner_statics_1.CloudRunnerStatics.logPrefix}] ${message}`;
|
||||
if (cloud_runner_1.default.buildParameters.cloudRunnerIntegrationTests) {
|
||||
output += message;
|
||||
output += `${message}\n`;
|
||||
}
|
||||
cloud_runner_logger_1.default.log(message);
|
||||
cloud_runner_logger_1.default.log(`[${cloud_runner_statics_1.CloudRunnerStatics.logPrefix}] ${message}`);
|
||||
return { shouldReadLogs, shouldCleanup, output };
|
||||
}
|
||||
}
|
||||
|
|
@ -4665,6 +4706,7 @@ const cloud_runner_custom_hooks_1 = __nccwpck_require__(58873);
|
|||
const path_1 = __importDefault(__nccwpck_require__(71017));
|
||||
const cloud_runner_1 = __importDefault(__nccwpck_require__(79144));
|
||||
const cloud_runner_options_1 = __importDefault(__nccwpck_require__(96552));
|
||||
const shared_workspace_locking_1 = __importDefault(__nccwpck_require__(67170));
|
||||
class BuildAutomationWorkflow {
|
||||
run(cloudRunnerStepState) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
|
|
@ -4695,6 +4737,8 @@ class BuildAutomationWorkflow {
|
|||
cloud_runner_logger_1.default.log(baseImage.toString());
|
||||
cloud_runner_logger_1.default.logLine(` `);
|
||||
cloud_runner_logger_1.default.logLine('Starting build automation job');
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const workspace = shared_workspace_locking_1.default.GetLockedWorkspace() || cloud_runner_1.default.buildParameters.buildGuid;
|
||||
output += yield cloud_runner_1.default.Provider.runTask(cloud_runner_1.default.buildParameters.buildGuid, baseImage.toString(), BuildAutomationWorkflow.BuildWorkflow, `/${cloud_runner_folders_1.CloudRunnerFolders.buildVolumeFolder}`, `/${cloud_runner_folders_1.CloudRunnerFolders.buildVolumeFolder}/`, cloud_runner_1.default.cloudRunnerEnvironmentVariables, cloud_runner_1.default.defaultSecrets);
|
||||
if (!cloud_runner_1.default.buildParameters.isCliMode)
|
||||
core.endGroup();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +1,33 @@
|
|||
export class SharedWorkspaceLocking {}
|
||||
export class SharedWorkspaceLocking {
|
||||
public static GetLockedWorkspace() {
|
||||
const workspaces = SharedWorkspaceLocking.GetFreeWorkspaces();
|
||||
for (const element of workspaces) {
|
||||
if (SharedWorkspaceLocking.LockWorkspace(element)) {
|
||||
return element;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public static GetFreeWorkspaces(): string[] {
|
||||
return [];
|
||||
}
|
||||
public static GetAllWorkspaces(): string[] {
|
||||
return [];
|
||||
}
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
public static LockWorkspace(workspace: string): boolean {
|
||||
return true;
|
||||
}
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
public static IsWorkspaceLocked(workspace: string) {}
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
public static HasWorkspaceLock(workspace: string) {}
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
public static CreateLockableWorkspace(workspace: string, locked: boolean = false) {}
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
public static ReleaseLock(workspace: string) {}
|
||||
}
|
||||
|
||||
export default SharedWorkspaceLocking;
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@ export class FollowLogStreamService {
|
|||
shouldCleanup = false;
|
||||
core.warning('cloud runner stop watching');
|
||||
}
|
||||
message = `[${CloudRunnerStatics.logPrefix}] ${message}`;
|
||||
if (CloudRunner.buildParameters.cloudRunnerIntegrationTests) {
|
||||
output += message;
|
||||
output += `${message}\n`;
|
||||
}
|
||||
CloudRunnerLogger.log(message);
|
||||
CloudRunnerLogger.log(`[${CloudRunnerStatics.logPrefix}] ${message}`);
|
||||
|
||||
return { shouldReadLogs, shouldCleanup, output };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { CloudRunnerCustomHooks } from '../services/cloud-runner-custom-hooks';
|
|||
import path from 'path';
|
||||
import CloudRunner from '../cloud-runner';
|
||||
import CloudRunnerOptions from '../cloud-runner-options';
|
||||
import SharedWorkspaceLocking from '../../cli/shared-workspace-locking';
|
||||
|
||||
export class BuildAutomationWorkflow implements WorkflowInterface {
|
||||
async run(cloudRunnerStepState: CloudRunnerStepState) {
|
||||
|
|
@ -36,6 +37,9 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
|
|||
CloudRunnerLogger.logLine(` `);
|
||||
CloudRunnerLogger.logLine('Starting build automation job');
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const workspace = SharedWorkspaceLocking.GetLockedWorkspace() || CloudRunner.buildParameters.buildGuid;
|
||||
|
||||
output += await CloudRunner.Provider.runTask(
|
||||
CloudRunner.buildParameters.buildGuid,
|
||||
baseImage.toString(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue