osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/31418 )
Change subject: jobs/gerrit-pipeline-endianness: new job ......................................................................
jobs/gerrit-pipeline-endianness: new job
Add a new job that runs struct_endianness.py from libosmocore.git and complains if there is a diff. The next patch adds it to the pipeline.
Related: OS#5884 Change-Id: Ie12ef58905e5cdf1fb6816b59efb65c0e56b5e8d --- A jobs/gerrit-pipeline-endianness.yml 1 file changed, 126 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, approved
diff --git a/jobs/gerrit-pipeline-endianness.yml b/jobs/gerrit-pipeline-endianness.yml new file mode 100644 index 0000000..1b0f423 --- /dev/null +++ b/jobs/gerrit-pipeline-endianness.yml @@ -0,0 +1,113 @@ +# This script runs struct_endianness.py from libosmocore.git. +# Add project's repositories to jobs/gerrit-verifications.yml. When +# pipeline_endianness is set for that project, the pipeline will call this job. + +- project: + name: gerrit-pipeline-endianness + jobs: + - 'gerrit-pipeline-endianness' + +- job: + name: 'gerrit-pipeline-endianness' + project-type: freestyle + node: osmocom-gerrit + retry-count: 3 # scm checkout + properties: + - build-discarder: + days-to-keep: 30 + num-to-keep: 120 + artifact-days-to-keep: -1 + artifact-num-to-keep: -1 + description: | + Run <code>struct_endianness.py</code> from libosmocore.git on patches + sent to <a href="https://gerrit.osmocom.org">gerrit</a>. + </br></br> + Related issue: <a href="https://osmocom.org/issues/5884">OS#5884</a> + + parameters: + - string: + name: BRANCH_LIBOSMOCORE + description: | + libosmocore.git branch + default: 'master' + - string: + name: GERRIT_PROJECT + description: set by gerrit verification pipeline job + - string: + name: GERRIT_CHANGE_NUMBER + description: set by gerrit verification pipeline job + - string: + name: GERRIT_PATCHSET_NUMBER + description: set by gerrit verification pipeline job + - string: + name: GERRIT_BRANCH + description: set by gerrit verification pipeline job + - string: + name: GERRIT_HOST + description: set by gerrit verification pipeline job + - string: + name: GERRIT_PATCHSET_REVISION + description: set by gerrit verification pipeline job + - string: + name: GERRIT_PORT + description: set by gerrit verification pipeline job + - string: + name: GERRIT_REFSPEC + description: set by gerrit verification pipeline job + - string: + name: GERRIT_REPO_URL + description: set by gerrit verification pipeline job + + scm: + - git: + basedir: 'code-from-gerrit' + url: '$GERRIT_REPO_URL' + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + refspec: $GERRIT_REFSPEC + choosing-strategy: gerrit + wipe-workspace: true + skip-tag: true + submodule: + recursive: false + + builders: + - shell: | + rm -rf libosmocore + git clone \ + --depth=1 \ + --branch="$BRANCH_LIBOSMOCORE" \ + https://gerrit.osmocom.org/libosmocore \ + libosmocore + git -C libosmocore log --oneline + + cd code-from-gerrit + ../libosmocore/contrib/struct_endianness.py + + case "$GERRIT_PROJECT" in + osmocom-bb) + # See https://gerrit.osmocom.org/c/osmocom-bb/+/31403 + EXCLUDE_ARG=":^src/shared/libosmocore" + ;; + esac + + git diff --color=always -- . $EXCLUDE_ARG + + if ! git diff --quiet -- . $EXCLUDE_ARG; then + set +x + echo '\033[1m' # bold font + echo "ERROR: auto-generated big-endian definitions missing or in unexpected format!" + echo + echo "Please run contrib/struct_endianness.py from libosmocore.git on your patch." + echo '\033[0m' # normal font + exit 1 + fi + wrappers: + - ansicolor: + colormap: xterm + - ssh-agent-credentials: + users: + - d5eda5e9-b59d-44ba-88d2-43473cb6e42d + +# vim: expandtab tabstop=2 shiftwidth=2