From ef01362bd84bf64cf35eac0f39058b5c0bcc8bae Mon Sep 17 00:00:00 2001 From: Otto Liljalaakso Date: Jul 25 2024 19:20:49 +0000 Subject: Check packagers order using Zuul CI This automates the procedure where each tutorial follower needs to add their FAS ID in alphabetic order, and thus considerably reduces the chance of merge conflicts that would happen if everybody just added to the end of file. --- diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..e4fa943 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,8 @@ +- project: + check: + jobs: + - check-packagers-order +- job: + name: check-packagers-order + description: Check packagers file + run: ci/check-packagers-order.yaml diff --git a/ci/check-packagers-order b/ci/check-packagers-order new file mode 100755 index 0000000..5e7c178 --- /dev/null +++ b/ci/check-packagers-order @@ -0,0 +1,8 @@ +#!/usr/bin/bash +DATAFILE="share/packagers" +DATA=$(<$DATAFILE) +SORTED=$(sort $DATAFILE) +if [ "$DATA" != "$SORTED" ]; then + echo "$DATAFILE is not sorted. Sort it with 'sort $DATAFILE -o $DATAFILE'" + exit 1 +fi diff --git a/ci/check-packagers-order.yaml b/ci/check-packagers-order.yaml new file mode 100644 index 0000000..0574638 --- /dev/null +++ b/ci/check-packagers-order.yaml @@ -0,0 +1,6 @@ +- hosts: all + tasks: + - name: Check packagers order + ansible.builtin.command: + chdir: "{{ zuul.project.src_dir }}" + cmd: ci/check-packagers-order diff --git a/test/test_data_order.sh b/test/test_data_order.sh deleted file mode 100755 index a9695d5..0000000 --- a/test/test_data_order.sh +++ /dev/null @@ -1,7 +0,0 @@ -DATAFILE="share/packagers" -DATA=$(<$DATAFILE) -SORTED=$(sort $DATAFILE) -if [ "$DATA" != "$SORTED" ]; then - echo "$DATAFILE is not sorted. Sort it with 'sort $DATAFILE -o $DATAFILE'" - exit 1 -fi