check if commit is on master
This commit is contained in:
40
.circleci/check-commit.sh
Executable file
40
.circleci/check-commit.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
# check to see that submodule commits are present on the master branch
|
||||
|
||||
# turn echo on and error on earliest command
|
||||
set -ex
|
||||
|
||||
# enter bhd repo
|
||||
cd $HOME/project
|
||||
|
||||
# initialize submodules and get the hashes
|
||||
git submodule update --init
|
||||
status=$(git submodule status)
|
||||
|
||||
search () {
|
||||
for submodule in "${submodules[@]}"
|
||||
do
|
||||
echo "Running check on submodule $submodule in $dir"
|
||||
hash=$(echo "$status" | grep $submodule | awk '{print$1}' | grep -o "[[:alnum:]]*")
|
||||
echo "Searching for $hash in origin/master of $submodule"
|
||||
git -C $dir/$submodule log origin/master | grep "$hash" # needs init'ed submodules
|
||||
done
|
||||
}
|
||||
|
||||
submodules=("boom" "hwacha" "rocket-chip" "sifive-blocks" "testchipip")
|
||||
dir="generators"
|
||||
|
||||
search
|
||||
|
||||
submodules=("esp-tools" "riscv-tools")
|
||||
dir="toolchains"
|
||||
|
||||
search
|
||||
|
||||
submodules=("barstools" "chisel3" "firrtl" "torture")
|
||||
dir="tools"
|
||||
|
||||
search
|
||||
|
||||
echo "Done checking all submodules"
|
||||
Reference in New Issue
Block a user