Description from pre/post/custom build steps
parent
fa2f7dc938
commit
0c0e0ae9af
|
|
@ -29,7 +29,7 @@ inputs:
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
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)'
|
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
|
required: false
|
||||||
default: ''
|
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)'
|
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,
|
kubeVolume: input_1.default.kubeVolume,
|
||||||
postBuildSteps: input_1.default.postBuildSteps,
|
postBuildSteps: input_1.default.postBuildSteps,
|
||||||
preBuildSteps: input_1.default.preBuildSteps,
|
preBuildSteps: input_1.default.preBuildSteps,
|
||||||
customBuildSteps: input_1.default.customBuildSteps,
|
customJob: input_1.default.customJob,
|
||||||
runNumber: input_1.default.runNumber,
|
runNumber: input_1.default.runNumber,
|
||||||
branch: yield input_1.default.branch(),
|
branch: yield input_1.default.branch(),
|
||||||
githubRepo: input_1.default.githubRepo,
|
githubRepo: input_1.default.githubRepo,
|
||||||
|
|
@ -3094,17 +3094,17 @@ class WorkflowCompositionRoot {
|
||||||
static runJob(baseImage) {
|
static runJob(baseImage) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
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));
|
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));
|
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));
|
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 {
|
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) {
|
catch (error) {
|
||||||
|
|
@ -3728,8 +3728,8 @@ class Input {
|
||||||
static get preBuildSteps() {
|
static get preBuildSteps() {
|
||||||
return Input.getInput('preBuildSteps') || '';
|
return Input.getInput('preBuildSteps') || '';
|
||||||
}
|
}
|
||||||
static get customBuildSteps() {
|
static get customJob() {
|
||||||
return Input.getInput('customBuildSteps') || '';
|
return Input.getInput('customJobs') || '';
|
||||||
}
|
}
|
||||||
static get cloudRunnerCluster() {
|
static get cloudRunnerCluster() {
|
||||||
return Input.getInput('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 postBuildSteps!: string;
|
||||||
public preBuildSteps!: string;
|
public preBuildSteps!: string;
|
||||||
public customBuildSteps!: string;
|
public customJob!: string;
|
||||||
public runNumber!: string;
|
public runNumber!: string;
|
||||||
public branch!: string;
|
public branch!: string;
|
||||||
public githubRepo!: string;
|
public githubRepo!: string;
|
||||||
|
|
@ -94,7 +94,7 @@ class BuildParameters {
|
||||||
kubeVolume: Input.kubeVolume,
|
kubeVolume: Input.kubeVolume,
|
||||||
postBuildSteps: Input.postBuildSteps,
|
postBuildSteps: Input.postBuildSteps,
|
||||||
preBuildSteps: Input.preBuildSteps,
|
preBuildSteps: Input.preBuildSteps,
|
||||||
customBuildSteps: Input.customBuildSteps,
|
customJob: Input.customJob,
|
||||||
runNumber: Input.runNumber,
|
runNumber: Input.runNumber,
|
||||||
branch: await Input.branch(),
|
branch: await Input.branch(),
|
||||||
githubRepo: Input.githubRepo,
|
githubRepo: Input.githubRepo,
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ describe('Cloud Runner', () => {
|
||||||
Input.cliOptions = {
|
Input.cliOptions = {
|
||||||
versioning: 'None',
|
versioning: 'None',
|
||||||
projectPath: 'test-project',
|
projectPath: 'test-project',
|
||||||
customBuildSteps: `
|
customJob: `
|
||||||
- name: 'step 1'
|
- name: 'step 1'
|
||||||
image: 'alpine'
|
image: 'alpine'
|
||||||
commands: ['printenv']
|
commands: ['printenv']
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export class WorkflowCompositionRoot implements WorkflowInterface {
|
||||||
|
|
||||||
private static async runJob(baseImage: any) {
|
private static async runJob(baseImage: any) {
|
||||||
try {
|
try {
|
||||||
if (CloudRunnerState.buildParams.customBuildSteps === '') {
|
if (CloudRunnerState.buildParams.customJob === '') {
|
||||||
await new BuildAutomationWorkflow().run(
|
await new BuildAutomationWorkflow().run(
|
||||||
new CloudRunnerStepState(
|
new CloudRunnerStepState(
|
||||||
baseImage,
|
baseImage,
|
||||||
|
|
@ -25,7 +25,7 @@ export class WorkflowCompositionRoot implements WorkflowInterface {
|
||||||
CloudRunnerState.defaultSecrets,
|
CloudRunnerState.defaultSecrets,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (CloudRunnerState.buildParams.customBuildSteps === 'ephemeral') {
|
} else if (CloudRunnerState.buildParams.customJob === 'ephemeral') {
|
||||||
await new EphemeralGitHubRunnerWorkflow().run(
|
await new EphemeralGitHubRunnerWorkflow().run(
|
||||||
new CloudRunnerStepState(
|
new CloudRunnerStepState(
|
||||||
baseImage,
|
baseImage,
|
||||||
|
|
@ -33,7 +33,7 @@ export class WorkflowCompositionRoot implements WorkflowInterface {
|
||||||
CloudRunnerState.defaultSecrets,
|
CloudRunnerState.defaultSecrets,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (CloudRunnerState.buildParams.customBuildSteps === 'download') {
|
} else if (CloudRunnerState.buildParams.customJob === 'download') {
|
||||||
await new SetupStep().run(
|
await new SetupStep().run(
|
||||||
new CloudRunnerStepState(
|
new CloudRunnerStepState(
|
||||||
'alpine/git',
|
'alpine/git',
|
||||||
|
|
@ -42,7 +42,7 @@ export class WorkflowCompositionRoot implements WorkflowInterface {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await CustomWorkflow.runCustomJob(CloudRunnerState.buildParams.customBuildSteps);
|
await CustomWorkflow.runCustomJob(CloudRunnerState.buildParams.customJob);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw error;
|
throw error;
|
||||||
|
|
|
||||||
|
|
@ -183,8 +183,8 @@ class Input {
|
||||||
return Input.getInput('preBuildSteps') || '';
|
return Input.getInput('preBuildSteps') || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
static get customBuildSteps() {
|
static get customJob() {
|
||||||
return Input.getInput('customBuildSteps') || '';
|
return Input.getInput('customJobs') || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
static get cloudRunnerCluster() {
|
static get cloudRunnerCluster() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue