summaryrefslogtreecommitdiffstats
path: root/sanity/system_light/scripts/glusterfs_build.sh
blob: d12e191cddac445a580c0839d96144cf20ef4983 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

# This script takes glusterfs tar file, untars it and builds it.

function main ()
{

    echo "cloning from the git:`date +%T`" >>$LOG_FILE
    time git clone git://git.gluster.com/glusterfs.git glusterfs.git 2>>$LOG_FILE 1>>$LOG_FILE
    if [ $? -ne 0 ]; then
        echo "Cannot clone the git repository"
        tar -xvf $GLUSTERFS_TAR_FILE
        mv glusterfs-$GFS_VERSION glusterfs.git
    fi

    cd $GLUSTERFS_DIR

    echo "running autogen.sh:`date +%T`"
    time ./autogen.sh 2>>$LOG_FILE 1>>$LOG_FILE 

    if [ $? -ne 0 ]; then
        echo "autogen failed:`date +%T`";
        return 11;
    fi

    echo "running configure:`date +%T`"
    time ./configure 2>>$LOG_FILE 1>>$LOG_FILE 

    if [ $? -ne 0 ]; then
        echo "configure failed:`date +%T`";
        return 11;
    fi
    

    echo "running make:`date +%T`"
    time make -j 32 2>>$LOG_FILE 1>>$LOG_FILE 

    if [ $? -ne 0 ]; then
        echo "make failed:`date +%T`";
	return 11;
    else
	echo "all successful:`date +%T`"
        return 0;
    fi

}

main "$@"