Added update.sh

master
Felix Stupp 6 years ago
parent 1ac506b8f2
commit 9fa7bda97d
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -3,3 +3,13 @@
A small collection of scripts I use to control and automatically update my servers.
**Released under GNU General Public License v3.0**
## update.sh
```
Usage: update.sh [dir]
```
Updates the current (or given) git repository to the newest tag with given prefix (defined inline, by default "*^release*").
Therefore, checks if the given tag is signed correctly by a gpg key with ultimate trust,
otherwise the script will abort the update and exit with error code 1.

@ -0,0 +1,18 @@
#!/bin/bash
set -e -u;
if [ $# -eq 1 ]; then
cd "$1";
fi
PREFIX=release;
git pull --tags;
TAG=$(git tag --list | grep "^$PREFIX-" | sort -r | head -n 1);
if git verify-tag "$TAG" | grep "TRUST_ULTIMATE" 2>&1 > /dev/null; then
git checkout "$TAG";
./configure.sh;
else
exit 1;
fi
Loading…
Cancel
Save