build.sh: deal with Git history being changed upstream

and some drive-by improvements
This commit is contained in:
Ștefan Talpalaru 2020-11-12 02:29:17 +01:00 committed by Jakub
parent b452c6cddc
commit ffa65e00e0
1 changed files with 9 additions and 4 deletions

View File

@ -15,7 +15,9 @@ TAG="{{ item.name }}"
pushd repo
COMMIT_BEFORE=$(git rev-parse --short=8 HEAD)
git pull
# We cannot use "git pull" in here, because history may be changed upstream
git fetch
git reset --hard origin/{{ item.branch }}
COMMIT_AFTER=$(git rev-parse --short=8 HEAD)
if [[ "$1" == "--force" ]]; then
@ -25,10 +27,13 @@ elif [[ "${COMMIT_BEFORE}" == "${COMMIT_AFTER}" ]]; then
exit
fi
make update
make \
# Lower CPU and I/O priority so it doesn't affect the running beacon node
NICE="nice -n 19 ionice -c2 -n7"
${NICE} make -j$(nproc) update
${NICE} make \
-j$(nproc) \
LOG_LEVEL="TRACE" \
MAKEFLAGS="-j$(nproc)" \
NIMFLAGS="-d:insecure -d:testnet_servers_image" \
{{ item.targets | join(" ") }}