diff options
author | Karel Kočí <cynerd@email.cz> | 2021-03-01 11:35:48 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2021-03-01 11:35:48 +0100 |
commit | 71e6115c86a603e9a6c27d371efbb94575d557d5 (patch) | |
tree | e6cb62a808729474c9435b49a6a098f265988a51 /templates | |
parent | 13eccf096bd63204ac24bd4a5b6cbf078763225b (diff) | |
download | laminar-cnf-71e6115c86a603e9a6c27d371efbb94575d557d5.tar.gz laminar-cnf-71e6115c86a603e9a6c27d371efbb94575d557d5.tar.bz2 laminar-cnf-71e6115c86a603e9a6c27d371efbb94575d557d5.zip |
turris: do not rebuild if not needed
This hould make building HBT and HBS viable as I would not waste
resources on building those feeds every night.
Diffstat (limited to 'templates')
-rwxr-xr-x | templates/turris.run | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/templates/turris.run b/templates/turris.run index 58a4714..0e98531 100755 --- a/templates/turris.run +++ b/templates/turris.run @@ -18,7 +18,18 @@ shift # Shift --locked curl "https://repo.turris.cz/$ANIMAL/$BOARD/packages/git-hash" > git-hash cat git-hash -if [ -z "$CLEAN" ] && [ -f "$WORKSPACE/openwrt-git-hash" ] && cmp -s git-hash "$WORKSPACE/openwrt-git-hash"; then +new_upstream="n" +cmp -s git-hash "$WORKSPACE/openwrt-git-hash" || new_upstream="y" + +latest_master="$(echo list \ + | git remote-https https://git.cynerd.cz/openwrt-personal-pkgs \ + | awk '$2 == "refs/heads/master" { print $1 }')" +if [ "$new_upstream" = "n" ] && [ "$latest_master" = "$(cat "$WORKSPACE/personal-git-hash")" ]; then + echo_info "Latest version of personal packages is already build." + exit 0 +fi + +if [ -z "$CLEAN" ] && [ -f "$WORKSPACE/openwrt-git-hash" ] && [ "$new_upstream" = "n" ]; then echo_info "Using previous version of SDK" tar -xzf "$WORKSPACE/openwrt.tar.gz" else @@ -79,3 +90,4 @@ ssh upload /bin/sh -se "$ANIMAL" "$BOARD" <<"EOF" rm -rf "/var/www/repo/turris/$1/$2" mv "deploy-turris-$1-$2" "/var/www/repo/turris/$1/$2" EOF +echo "$latest_master" > "$WORKSPACE/personal-git-hash" |