Stub custom hook+step file parameter and CLI command to run

pull/461/head
Frostebite 2022-09-17 01:27:38 +01:00
parent 38b7b8e1f9
commit b964d3100a
6 changed files with 40 additions and 1 deletions

View File

@ -98,6 +98,14 @@ 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)'
customStepFiles:
required: false
default: ''
description: 'Specify the names (by file name) of custom steps to run before or after cloud runner jobs, must match a yaml step file inside your repo in the folder .game-ci/steps/'
customHookFiles:
required: false
default: ''
description: 'Specify the names (by file name) of custom hooks to run before or after cloud runner jobs, must match a yaml step file inside your repo in the folder .game-ci/hooks/'
customJobHooks:
required: false
default: ''

8
dist/index.js vendored
View File

@ -280,6 +280,8 @@ class BuildParameters {
kubeVolume: cloud_runner_options_1.default.kubeVolume,
postBuildSteps: cloud_runner_options_1.default.postBuildSteps,
preBuildSteps: cloud_runner_options_1.default.preBuildSteps,
customStepFiles: cloud_runner_options_1.default.customStepFiles,
customHookFiles: cloud_runner_options_1.default.customHookFiles,
customJob: cloud_runner_options_1.default.customJob,
runNumber: input_1.default.runNumber,
branch: input_1.default.branch.replace('/head', '') || (yield git_repo_1.GitRepoReader.GetBranch()),
@ -735,6 +737,12 @@ class CloudRunnerOptions {
return CloudRunnerOptions.getInput(`GitSHA`);
}
}
static get customStepFiles() {
return CloudRunnerOptions.getInput('customStepFiles') || '';
}
static get customHookFiles() {
return CloudRunnerOptions.getInput('customHookFiles') || '';
}
static get customJob() {
return CloudRunnerOptions.getInput('customJob') || '';
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -52,6 +52,8 @@ class BuildParameters {
public postBuildSteps!: string;
public preBuildSteps!: string;
public customStepFiles!: string;
public customHookFiles!: string;
public customJob!: string;
public runNumber!: string;
public branch!: string;
@ -121,6 +123,8 @@ class BuildParameters {
kubeVolume: CloudRunnerOptions.kubeVolume,
postBuildSteps: CloudRunnerOptions.postBuildSteps,
preBuildSteps: CloudRunnerOptions.preBuildSteps,
customStepFiles: CloudRunnerOptions.customStepFiles,
customHookFiles: CloudRunnerOptions.customHookFiles,
customJob: CloudRunnerOptions.customJob,
runNumber: Input.runNumber,
branch: Input.branch.replace('/head', '') || (await GitRepoReader.GetBranch()),

View File

@ -0,0 +1,11 @@
import CloudRunnerLogger from '../cloud-runner/services/cloud-runner-logger';
import { CliFunction } from './cli-functions-repository';
export class CustomBehaviourFiles {
@CliFunction(`run-hooks`, `runs custom hooks`)
public static async RunCustomHookFiles() {
CloudRunnerLogger.log('Run custom hooks');
}
}
export default CustomBehaviourFiles;

View File

@ -69,6 +69,14 @@ class CloudRunnerOptions {
}
}
static get customStepFiles() {
return CloudRunnerOptions.getInput('customStepFiles') || '';
}
static get customHookFiles() {
return CloudRunnerOptions.getInput('customHookFiles') || '';
}
static get customJob() {
return CloudRunnerOptions.getInput('customJob') || '';
}