Skip to content

Commit

Permalink
prevent merging changes to kickstart.sh when checksum in docs is wrong (
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfantom committed Feb 25, 2019
1 parent 49096cc commit 48a15d1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
script: cp web/gui/dashboard.js /tmp/dashboard.js && ./build/build.sh && diff /tmp/dashboard.js web/gui/dashboard.js
- name: lint .sh.in files
script: shellcheck --format=gcc $(find . -name '*.sh.in' -not -iwholename '*.git*')
- name: check checksums for kickstart files
script: ./tests/installer/checksums.sh
- name: coverity
install: sudo apt-get install -y zlib1g-dev uuid-dev libipmimonitoring-dev libmnl-dev libnetfilter-acct-dev
script: ./coverity-scan.sh || echo "Coverity failed :("
Expand Down
19 changes: 19 additions & 0 deletions tests/installer/checksums.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

if [ ! -f .gitignore ]; then
echo "Run as ./tests/installer/$(basename "$0") from top level directory of git repository"
exit 1
fi

for file in kickstart.sh kickstart-static64.sh; do
OLD_CHECKSUM=$(grep "$file" packaging/installer/README.md | grep md5sum | cut -d '"' -f2)
NEW_CHECKSUM="$(md5sum "packaging/installer/$file" | cut -d' ' -f1)"
if [ "$OLD_CHECKSUM" != "$NEW_CHECKSUM" ]; then
echo "Invalid checksum for $file in docs."
echo "checksum in docs: $OLD_CHECKSUM"
echo "current checksum: $NEW_CHECKSUM"
exit 1
fi
done

0 comments on commit 48a15d1

Please sign in to comment.