diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-10-03 16:55:13 (GMT) |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-10-03 16:55:13 (GMT) |
commit | d5e014a3db0459e093cbef18589f8916deb5ad8a (patch) | |
tree | dbf8f13cced58b144872261f2ed0b16ff9c25db8 /bin | |
parent | ab2e2205aa57ad261aaa139dc4e058a67a1399d8 (diff) | |
download | site-d5e014a3db0459e093cbef18589f8916deb5ad8a.tar.gz |
build-snapshot: Don't rebuild existing snapshots
Build snapshot only once if multiple branches point(ed) to the same
commit.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/build-snapshot | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/build-snapshot b/bin/build-snapshot index 18777a5..651edd7 100755 --- a/bin/build-snapshot +++ b/bin/build-snapshot | |||
@@ -42,11 +42,14 @@ create_snapshot() | |||
42 | version=$(git describe --abbrev=4 'HEAD' | sed 's/release-//') | 42 | version=$(git describe --abbrev=4 'HEAD' | sed 's/release-//') |
43 | tarball="nagios-plugins-$version.tar.gz" | 43 | tarball="nagios-plugins-$version.tar.gz" |
44 | symlink="nagios-plugins-$branch.tar.gz" | 44 | symlink="nagios-plugins-$branch.tar.gz" |
45 | make_dist "$version" | ||
46 | cp "$tarball" "$snapshot_dir" | ||
47 | git reset --quiet --hard | ||
48 | git clean --quiet --force -d -x | ||
49 | 45 | ||
46 | if [ ! -e "$snapshot_dir/$tarball" ] | ||
47 | then | ||
48 | make_dist "$version" | ||
49 | cp "$tarball" "$snapshot_dir" | ||
50 | git reset --quiet --hard | ||
51 | git clean --quiet --force -d -x | ||
52 | fi | ||
50 | cd "$snapshot_dir" | 53 | cd "$snapshot_dir" |
51 | test -e "$tarball.sha1" || shasum -a 1 -b "$tarball" >"$tarball.sha1" | 54 | test -e "$tarball.sha1" || shasum -a 1 -b "$tarball" >"$tarball.sha1" |
52 | ln -s -f "$tarball" "$symlink" | 55 | ln -s -f "$tarball" "$symlink" |