Skip to content

Commit

Permalink
Use groovy stringParam over string or other non-default parameter spe…
Browse files Browse the repository at this point in the history
…cification

Reduction of tech dept

Change-Id: Iaffd20030a9240cdb3216570ec581fe25f716932
  • Loading branch information
JonasScharpf committed Jan 22, 2025
1 parent 3b53b7b commit 61d7e5e
Show file tree
Hide file tree
Showing 29 changed files with 47 additions and 38 deletions.
2 changes: 0 additions & 2 deletions buildscripts/scripts/build-cmk-packages.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -352,14 +352,12 @@ def main() {
}
}


def get_agent_list(edition) {
return (edition == "raw" ?
["windows"] :
["au-linux-64bit", "au-linux-32bit", "windows"]);
}


def build_linux_agent_updater(agent, edition, branch_version, registry) {
print("FN build_linux_agent_updater(agent=${agent}, edition=${edition}, branch_version=${branch_version}, registry=${registry})");

Expand Down
1 change: 1 addition & 0 deletions buildscripts/scripts/test-agent-plugin-unit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ def main() {
}
}
}

return this;
2 changes: 1 addition & 1 deletion buildscripts/scripts/test-clang_tidy.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ def main() {
}
}
}
return this;

return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/test-compile_cores.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ def main() {
}
}
}

return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/test-gerrit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ def main() {
time_stage_started = test_gerrit_helper.log_stage_duration(time_stage_started);
}
}

return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/test-github-actions.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ def main() {
}
}
}

return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/test-integration-docker.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ def main() {
}
}
}

return this;
2 changes: 1 addition & 1 deletion buildscripts/scripts/test-iwyu.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ def main() {
}
}
}
return this;

return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/test-package-cmk-agent-ctl.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ def main() {
}
}
}

return this;
2 changes: 1 addition & 1 deletion buildscripts/scripts/test-package-livestatus.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ def main() {
}
}
}
return this;

return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/test-python3-bandit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ def main() {
}
}
}

return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/test-python3-code-quality.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ def main() {
}
}
}

return this;
2 changes: 1 addition & 1 deletion buildscripts/scripts/test-python3-format.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ def main() {
}
}
}
return this;

return this;
2 changes: 1 addition & 1 deletion buildscripts/scripts/test-python3-pylint.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ def main() {
}
}
}
return this;

return this;
2 changes: 1 addition & 1 deletion buildscripts/scripts/test-python3-unit-all.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ def main() {
}
}
}
return this;

return this;
2 changes: 1 addition & 1 deletion buildscripts/scripts/test-shell-unit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ def main() {
}
}
}
return this;

return this;
3 changes: 1 addition & 2 deletions buildscripts/scripts/test-shell_format.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ def main() {
);
}
}
return this;


return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/test-shellcheck_agents.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ def main() {
}
}
}

return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/test-unit-test-cores.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ def main() {
}
}
}

return this;
6 changes: 3 additions & 3 deletions buildscripts/scripts/trigger-all-nightlies-fast.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def main() {
def editions = versioning.get_editions();

def job_parameters = [
[$class: 'StringParameterValue', name: 'CIPARAM_OVERRIDE_BUILD_NODE', value: params.TRIGGER_CIPARAM_OVERRIDE_BUILD_NODE],
[$class: 'StringParameterValue', name: 'CIPARAM_BISECT_COMMENT', value: params.CIPARAM_BISECT_COMMENT],
stringParam(name: 'CIPARAM_OVERRIDE_BUILD_NODE', value: params.TRIGGER_CIPARAM_OVERRIDE_BUILD_NODE),
stringParam(name: 'CIPARAM_BISECT_COMMENT', value: params.CIPARAM_BISECT_COMMENT),
];

def override_distros = params.EDITIONS.trim() ?: "";
Expand All @@ -32,7 +32,7 @@ def main() {
for ( edition in editions ) {
catchError(buildResult: "FAILURE", stageResult: "FAILURE") {
stage("Trigger ${edition}") {
def this_job_parameters = job_parameters + [$class: 'StringParameterValue', name: 'EDITION', value: edition];
def this_job_parameters = job_parameters + [stringParam(name: 'EDITION', value: edition)];

print(
"""
Expand Down
38 changes: 19 additions & 19 deletions buildscripts/scripts/trigger-cmk-build-chain.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,28 @@ def main() {

/// NOTE: this way ALL parameter are being passed through..
def job_parameters = [
[$class: 'StringParameterValue', name: 'EDITION', value: edition],
stringParam(name: 'EDITION', value: edition),

// TODO perhaps use `params` + [EDITION]?
// FIXME: all parameters from all triggered jobs have to be handled here
[$class: 'StringParameterValue', name: 'VERSION', value: VERSION],
[$class: 'StringParameterValue', name: 'OVERRIDE_DISTROS', value: params.OVERRIDE_DISTROS],
[$class: 'BooleanParameterValue', name: 'SKIP_DEPLOY_TO_WEBSITE', value: params.SKIP_DEPLOY_TO_WEBSITE],
[$class: 'BooleanParameterValue', name: 'DEPLOY_TO_WEBSITE_ONLY', value: params.DEPLOY_TO_WEBSITE_ONLY],
[$class: 'BooleanParameterValue', name: 'FAKE_WINDOWS_ARTIFACTS', value: params.FAKE_WINDOWS_ARTIFACTS],
[$class: 'StringParameterValue', name: 'CIPARAM_OVERRIDE_DOCKER_TAG_BUILD', value: params.CIPARAM_OVERRIDE_DOCKER_TAG_BUILD],
[$class: 'BooleanParameterValue', name: 'SET_LATEST_TAG', value: params.SET_LATEST_TAG],
[$class: 'BooleanParameterValue', name: 'SET_BRANCH_LATEST_TAG', value: params.SET_BRANCH_LATEST_TAG],
[$class: 'BooleanParameterValue', name: 'PUSH_TO_REGISTRY', value: params.PUSH_TO_REGISTRY],
[$class: 'BooleanParameterValue', name: 'PUSH_TO_REGISTRY_ONLY', value: params.PUSH_TO_REGISTRY_ONLY],
[$class: 'BooleanParameterValue', name: 'BUILD_CLOUD_IMAGES', value: true],
[$class: 'StringParameterValue', name: 'CUSTOM_GIT_REF', value: params.CUSTOM_GIT_REF],
[$class: 'StringParameterValue', name: 'CIPARAM_OVERRIDE_BUILD_NODE', value: params.CIPARAM_OVERRIDE_BUILD_NODE],
[$class: 'StringParameterValue', name: 'CIPARAM_CLEANUP_WORKSPACE', value: params.CIPARAM_CLEANUP_WORKSPACE],
[$class: 'StringParameterValue', name: 'CIPARAM_BISECT_COMMENT', value: params.CIPARAM_BISECT_COMMENT],
stringParam(name: 'VERSION', value: VERSION),
stringParam(name: 'OVERRIDE_DISTROS', value: params.OVERRIDE_DISTROS),
booleanParam(name: 'SKIP_DEPLOY_TO_WEBSITE', value: params.SKIP_DEPLOY_TO_WEBSITE),
booleanParam(name: 'DEPLOY_TO_WEBSITE_ONLY', value: params.DEPLOY_TO_WEBSITE_ONLY),
booleanParam(name: 'FAKE_WINDOWS_ARTIFACTS', value: params.FAKE_WINDOWS_ARTIFACTS),
stringParam(name: 'CIPARAM_OVERRIDE_DOCKER_TAG_BUILD', value: params.CIPARAM_OVERRIDE_DOCKER_TAG_BUILD),
booleanParam(name: 'SET_LATEST_TAG', value: params.SET_LATEST_TAG),
booleanParam(name: 'SET_BRANCH_LATEST_TAG', value: params.SET_BRANCH_LATEST_TAG),
booleanParam(name: 'PUSH_TO_REGISTRY', value: params.PUSH_TO_REGISTRY),
booleanParam(name: 'PUSH_TO_REGISTRY_ONLY', value: params.PUSH_TO_REGISTRY_ONLY),
booleanParam(name: 'BUILD_CLOUD_IMAGES', value: true),
stringParam(name: 'CUSTOM_GIT_REF', value: params.CUSTOM_GIT_REF),
stringParam(name: 'CIPARAM_OVERRIDE_BUILD_NODE', value: params.CIPARAM_OVERRIDE_BUILD_NODE),
stringParam(name: 'CIPARAM_CLEANUP_WORKSPACE', value: params.CIPARAM_CLEANUP_WORKSPACE),
stringParam(name: 'CIPARAM_BISECT_COMMENT', value: params.CIPARAM_BISECT_COMMENT),
// PUBLISH_IN_MARKETPLACE will only be set during the release process (aka bw-release)
[$class: 'BooleanParameterValue', name: 'PUBLISH_IN_MARKETPLACE', value: false],
[$class: 'StringParameterValue', name: 'USE_CASE', value: use_case],
booleanParam(name: 'PUBLISH_IN_MARKETPLACE', value: false),
stringParam(name: 'USE_CASE', value: use_case),
];

// TODO we should take this list from a single source of truth
Expand Down Expand Up @@ -127,6 +127,6 @@ def main() {
}

currentBuild.result = success ? "SUCCESS" : "FAILURE";

}

return this;
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ def main() {
}
}
}

return this;
1 change: 0 additions & 1 deletion buildscripts/scripts/utils/docker_util.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ load("${checkout_dir}/buildscripts/scripts/utils/docker_image_aliases_helper.gro
get_docker_group_id = { it ->
cmd_output("getent group docker | cut -d: -f3");
}

2 changes: 1 addition & 1 deletion buildscripts/scripts/winagt-build-cmk-agent-ctl.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ def main() {
)
}
}
return this;

return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/winagt-build-modules.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ def main() {
}
}
}

return this;
1 change: 1 addition & 0 deletions buildscripts/scripts/winagt-build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ def main() {
}
}
}

return this;
2 changes: 1 addition & 1 deletion buildscripts/scripts/winagt-test-build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ def main() {
);
}
}
return this;

return this;
2 changes: 1 addition & 1 deletion buildscripts/scripts/winagt-test-integration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ def main() {
}
}
}
return this;

return this;
2 changes: 1 addition & 1 deletion buildscripts/scripts/winagt-test-unit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ def main() {
)
}
}
return this;

return this;

0 comments on commit 61d7e5e

Please sign in to comment.