osmo-ci/jobs/gerrit-pipeline-endianness.yml

110 lines
3.4 KiB
YAML

# 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
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
disable-submodules: true
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