]> arthur.barton.de Git - netdata.git/blob - packaging/git-build
Merge pull request #1968 from ktsaou/master
[netdata.git] / packaging / git-build
1 #!/bin/sh
2
3 # When run from the top-level repository, performs a complete clean
4 # and maintainer-mode rebuild of the FireHOL package.
5
6 if [ ! -f .gitignore -o ! -f configure.ac -o ! -x autogen.sh ]
7 then
8   echo "Run as ./packaging/git-build from an autotools git repository"
9   exit 1
10 fi
11
12 # If we are genuinely in a git repo, try to clean it up, otherwise
13 # just make the assumption
14 if [ -d .git ]
15 then
16   if [ -n "$TRAVIS_TAG" ]
17   then
18     echo "Checking we have a good signature during CI build..."
19     echo "Checking tag: $TRAVIS_TAG"
20     git tag -v "$TRAVIS_TAG" 2>&1 | tee /tmp/tagcheck
21     grep -iq "gpg. good signature" /tmp/tagcheck
22     status=$?
23     rm -f /tmp/tagcheck
24     if [ $status -ne 0 ]
25     then
26       exit $status
27     fi
28   fi
29
30   clean=$(git status -s | grep "^?")
31
32   if [ "$clean" ]
33   then
34     if [ "$1" != "-ok" ]
35     then
36       echo "Warning: this script runs: git clean -d -f -x"
37       echo "         ensure all required ?? files are added, then re-run with '-ok'"
38       git status -s | grep '^?'
39       exit 1
40     fi
41   fi
42
43   set -e
44   git clean -d -f -x
45   set +e
46 fi
47
48 set -e
49 ./autogen.sh
50 ./configure --enable-maintainer-mode 
51 set +e
52 make dist
53 status=$?
54 exit $status