Description from pre/post/custom build steps
parent
fa2f7dc938
commit
0c0e0ae9af
|
|
@ -29,7 +29,7 @@ inputs:
|
|||
required: false
|
||||
default: ''
|
||||
description: 'Run a pre build job after the repository setup but before the build job (in yaml format with the keys image, secrets (name, value object array), command line string)'
|
||||
customBuildSteps:
|
||||
customJob:
|
||||
required: false
|
||||
default: ''
|
||||
description: 'Run a custom job instead of the standard build automation for cloud runner (in yaml format with the keys image, secrets (name, value object array), command line string)'
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ class BuildParameters {
|
|||
kubeVolume: input_1.default.kubeVolume,
|
||||
postBuildSteps: input_1.default.postBuildSteps,
|
||||
preBuildSteps: input_1.default.preBuildSteps,
|
||||
customBuildSteps: input_1.default.customBuildSteps,
|
||||
customJob: input_1.default.customJob,
|
||||
runNumber: input_1.default.runNumber,
|
||||
branch: yield input_1.default.branch(),
|
||||
githubRepo: input_1.default.githubRepo,
|
||||
|
|
@ -3094,17 +3094,17 @@ class WorkflowCompositionRoot {
|
|||
static runJob(baseImage) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
if (cloud_runner_state_1.CloudRunnerState.buildParams.customBuildSteps === '') {
|
||||
if (cloud_runner_state_1.CloudRunnerState.buildParams.customJob === '') {
|
||||
yield new build_automation_workflow_1.BuildAutomationWorkflow().run(new cloud_runner_step_state_1.CloudRunnerStepState(baseImage, cloud_runner_state_1.CloudRunnerState.readBuildEnvironmentVariables(), cloud_runner_state_1.CloudRunnerState.defaultSecrets));
|
||||
}
|
||||
else if (cloud_runner_state_1.CloudRunnerState.buildParams.customBuildSteps === 'ephemeral') {
|
||||
else if (cloud_runner_state_1.CloudRunnerState.buildParams.customJob === 'ephemeral') {
|
||||
yield new ephemeral_github_runner_workflow_1.EphemeralGitHubRunnerWorkflow().run(new cloud_runner_step_state_1.CloudRunnerStepState(baseImage, cloud_runner_state_1.CloudRunnerState.readBuildEnvironmentVariables(), cloud_runner_state_1.CloudRunnerState.defaultSecrets));
|
||||
}
|
||||
else if (cloud_runner_state_1.CloudRunnerState.buildParams.customBuildSteps === 'download') {
|
||||
else if (cloud_runner_state_1.CloudRunnerState.buildParams.customJob === 'download') {
|
||||
yield new setup_step_1.SetupStep().run(new cloud_runner_step_state_1.CloudRunnerStepState('alpine/git', cloud_runner_state_1.CloudRunnerState.readBuildEnvironmentVariables(), cloud_runner_state_1.CloudRunnerState.defaultSecrets));
|
||||
}
|
||||
else {
|
||||
yield custom_workflow_1.CustomWorkflow.runCustomJob(cloud_runner_state_1.CloudRunnerState.buildParams.customBuildSteps);
|
||||
yield custom_workflow_1.CustomWorkflow.runCustomJob(cloud_runner_state_1.CloudRunnerState.buildParams.customJob);
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
|
|
@ -3728,8 +3728,8 @@ class Input {
|
|||
static get preBuildSteps() {
|
||||
return Input.getInput('preBuildSteps') || '';
|
||||
}
|
||||
static get customBuildSteps() {
|
||||
return Input.getInput('customBuildSteps') || '';
|
||||
static get customJob() {
|
||||
return Input.getInput('customJobs') || '';
|
||||
}
|
||||
static get cloudRunnerCluster() {
|
||||
return Input.getInput('cloudRunnerCluster') || '';
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -42,7 +42,7 @@ class BuildParameters {
|
|||
|
||||
public postBuildSteps!: string;
|
||||
public preBuildSteps!: string;
|
||||
public customBuildSteps!: string;
|
||||
public customJob!: string;
|
||||
public runNumber!: string;
|
||||
public branch!: string;
|
||||
public githubRepo!: string;
|
||||
|
|
@ -94,7 +94,7 @@ class BuildParameters {
|
|||
kubeVolume: Input.kubeVolume,
|
||||
postBuildSteps: Input.postBuildSteps,
|
||||
preBuildSteps: Input.preBuildSteps,
|
||||
customBuildSteps: Input.customBuildSteps,
|
||||
customJob: Input.customJob,
|
||||
runNumber: Input.runNumber,
|
||||
branch: await Input.branch(),
|
||||
githubRepo: Input.githubRepo,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ describe('Cloud Runner', () => {
|
|||
Input.cliOptions = {
|
||||
versioning: 'None',
|
||||
projectPath: 'test-project',
|
||||
customBuildSteps: `
|
||||
customJob: `
|
||||
- name: 'step 1'
|
||||
image: 'alpine'
|
||||
commands: ['printenv']
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export class WorkflowCompositionRoot implements WorkflowInterface {
|
|||
|
||||
private static async runJob(baseImage: any) {
|
||||
try {
|
||||
if (CloudRunnerState.buildParams.customBuildSteps === '') {
|
||||
if (CloudRunnerState.buildParams.customJob === '') {
|
||||
await new BuildAutomationWorkflow().run(
|
||||
new CloudRunnerStepState(
|
||||
baseImage,
|
||||
|
|
@ -25,7 +25,7 @@ export class WorkflowCompositionRoot implements WorkflowInterface {
|
|||
CloudRunnerState.defaultSecrets,
|
||||
),
|
||||
);
|
||||
} else if (CloudRunnerState.buildParams.customBuildSteps === 'ephemeral') {
|
||||
} else if (CloudRunnerState.buildParams.customJob === 'ephemeral') {
|
||||
await new EphemeralGitHubRunnerWorkflow().run(
|
||||
new CloudRunnerStepState(
|
||||
baseImage,
|
||||
|
|
@ -33,7 +33,7 @@ export class WorkflowCompositionRoot implements WorkflowInterface {
|
|||
CloudRunnerState.defaultSecrets,
|
||||
),
|
||||
);
|
||||
} else if (CloudRunnerState.buildParams.customBuildSteps === 'download') {
|
||||
} else if (CloudRunnerState.buildParams.customJob === 'download') {
|
||||
await new SetupStep().run(
|
||||
new CloudRunnerStepState(
|
||||
'alpine/git',
|
||||
|
|
@ -42,7 +42,7 @@ export class WorkflowCompositionRoot implements WorkflowInterface {
|
|||
),
|
||||
);
|
||||
} else {
|
||||
await CustomWorkflow.runCustomJob(CloudRunnerState.buildParams.customBuildSteps);
|
||||
await CustomWorkflow.runCustomJob(CloudRunnerState.buildParams.customJob);
|
||||
}
|
||||
} catch (error) {
|
||||
throw error;
|
||||
|
|
|
|||
|
|
@ -183,8 +183,8 @@ class Input {
|
|||
return Input.getInput('preBuildSteps') || '';
|
||||
}
|
||||
|
||||
static get customBuildSteps() {
|
||||
return Input.getInput('customBuildSteps') || '';
|
||||
static get customJob() {
|
||||
return Input.getInput('customJobs') || '';
|
||||
}
|
||||
|
||||
static get cloudRunnerCluster() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue