From dd6df9e26b1af9f6f2a66742d6b78acdb50451f7 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Fri, 21 Feb 2020 13:31:15 +0100 Subject: [PATCH] static slaves: Perform global-jjb init global-jjb was recently bumped to 0.51, which assumes jenkins-init-scripts were already executed on the build slave (e.g. by sourcing ~jenkins/lf-env.sh), which is always true for Openstack instances dynamically spawned by Jenkins, but not yet for static slaves like AArch64 dev/build/baremetal PODs. Add a new job, triggered on ci-management gerrit merge (only if global-jjb reference is changed) that executes the jenkins-init-scripts similar to dynamic slaves initialization. NOTE: Since jenkins-init-scripts are not fully idempotent, some actions (e.g. id_rsa keypair generation) are executed even though they are not mandatory (for the id_rsa keypair this means the private/public keys will be forcefully regenerated each time this new job runs). Change-Id: I62433a45c7966aed1d1184fa60e87ee4211996e4 Signed-off-by: Alexandru Avadanii --- jjb/akraino-templates/akraino-jjb-templates.yaml | 58 ++++++++++++++++++++++++ jjb/ci-management/static-slaves-ci-jobs.yaml | 16 +++++++ 2 files changed, 74 insertions(+) create mode 100644 jjb/ci-management/static-slaves-ci-jobs.yaml diff --git a/jjb/akraino-templates/akraino-jjb-templates.yaml b/jjb/akraino-templates/akraino-jjb-templates.yaml index 55d9c69..82d34dd 100644 --- a/jjb/akraino-templates/akraino-jjb-templates.yaml +++ b/jjb/akraino-templates/akraino-jjb-templates.yaml @@ -344,3 +344,61 @@ publishers: - lf-infra-publish + +- job-template: + id: akraino-project-build-node-init + name: '{project-name}-{build-node}-init' + disabled: '{obj:disabled}' + concurrent: true + + parameters: + - lf-infra-parameters: + project: '{project}' + stream: '{stream}' + branch: '{branch}' + - label: + name: '{build-node}' + default: '{build-node}' + node-eligibility: 'all' + all-nodes: true + + gerrit_merge_triggers: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: remerge$ + + gerrit_trigger_file_paths: + - compare-type: REG_EXP + pattern: 'global-jjb' + + scm: + - lf-infra-gerrit-scm: + jenkins-ssh-credential: '{jenkins-ssh-credential}' + git-url: '{git-url}/{project}.git' + refspec: '' + branch: '{branch}' + submodule-recursive: true + submodule-timeout: '{submodule-timeout}' + submodule-disable: false + choosing-strategy: default + + triggers: + - gerrit: + server-name: '{gerrit-server-name}' + trigger-on: '{obj:gerrit_merge_triggers}' + projects: + - project-compare-type: ANT + project-pattern: '{project}' + branches: + - branch-compare-type: ANT + branch-pattern: '**/{branch}' + file-paths: '{obj:gerrit_trigger_file_paths}' + + builders: + - description-setter: + description: "POD: $NODE_NAME" + - shell: | + #!/bin/bash -ex + export SWAP_SIZE=0 + sudo -E ./global-jjb/jenkins-init-scripts/init.sh + sudo chown jenkins:jenkins -R archives diff --git a/jjb/ci-management/static-slaves-ci-jobs.yaml b/jjb/ci-management/static-slaves-ci-jobs.yaml new file mode 100644 index 0000000..c07b550 --- /dev/null +++ b/jjb/ci-management/static-slaves-ci-jobs.yaml @@ -0,0 +1,16 @@ +--- +- project: + name: static-slaves-ci-jobs + + project: ci-management + project-name: ci-management + branch: master + stream: '{branch}' + + build-node: + - aarch64_dev + - aarch64_build + - aarch64_baremetal + + jobs: + - akraino-project-build-node-init -- 2.16.6