From ffa65e00e020e9f1295a70f55a822cae1e1c4086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Thu, 12 Nov 2020 02:29:17 +0100 Subject: [PATCH] build.sh: deal with Git history being changed upstream and some drive-by improvements --- .../roles/beacon-node-builds/templates/build.sh.j2 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ansible/roles/beacon-node-builds/templates/build.sh.j2 b/ansible/roles/beacon-node-builds/templates/build.sh.j2 index a02cd59..7910c92 100644 --- a/ansible/roles/beacon-node-builds/templates/build.sh.j2 +++ b/ansible/roles/beacon-node-builds/templates/build.sh.j2 @@ -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(" ") }}