-
Notifications
You must be signed in to change notification settings - Fork 222
/
jenkins_build.sh
executable file
·80 lines (61 loc) · 2.23 KB
/
jenkins_build.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
DIR="$PWD"
dtc_git_build () {
project="dtc"
server="git://git.kernel.org/pub/scm/utils/dtc/dtc.git"
if [ ! -d ${HOME}/git/ ] ; then
mkdir -p ${HOME}/git/ || true
fi
if [ ! -f ${HOME}/git/${project}/.git/config ] ; then
git clone ${server} ${HOME}/git/${project}/
fi
cd ${HOME}/git/${project}/
make clean
git checkout master -f
git pull || true
if [ ! "x${git_tag}" = "x" ] ; then
test_for_branch=$(git branch --list ${git_tag}-build)
if [ "x${test_for_branch}" != "x" ] ; then
git branch ${git_tag}-build -D
fi
git checkout ${git_tag} -b ${git_tag}-build
fi
make clean
make CC=gcc CROSS_COMPILE= all &> /dev/null
cd ${DIR}/
}
git_tag="v1.4.7"
dtc_git_build
echo "*********************************************"
echo "dtc: `/var/lib/jenkins/git/dtc/dtc --version`"
DTC=/var/lib/jenkins/git/dtc/dtc DTCVERSION=2.0.0 make clean
DTC=/var/lib/jenkins/git/dtc/dtc DTCVERSION=2.0.0 make all || exit 1
echo "*********************************************"
git_tag="v1.5.0"
dtc_git_build
echo "*********************************************"
echo "dtc: `/var/lib/jenkins/git/dtc/dtc --version`"
DTC=/var/lib/jenkins/git/dtc/dtc DTCVERSION=2.0.0 make clean
DTC=/var/lib/jenkins/git/dtc/dtc DTCVERSION=2.0.0 make all || exit 1
echo "*********************************************"
git_tag="v1.5.1"
dtc_git_build
echo "*********************************************"
echo "dtc: `/var/lib/jenkins/git/dtc/dtc --version`"
DTC=/var/lib/jenkins/git/dtc/dtc DTCVERSION=2.0.0 make clean
DTC=/var/lib/jenkins/git/dtc/dtc DTCVERSION=2.0.0 make all || exit 1
echo "*********************************************"
git_tag="v1.6.0"
dtc_git_build
echo "*********************************************"
echo "dtc: `/var/lib/jenkins/git/dtc/dtc --version`"
DTC=/var/lib/jenkins/git/dtc/dtc DTCVERSION=2.0.0 make clean
DTC=/var/lib/jenkins/git/dtc/dtc DTCVERSION=2.0.0 make all || exit 1
echo "*********************************************"
unset git_tag
dtc_git_build
echo "*********************************************"
echo "dtc: `/var/lib/jenkins/git/dtc/dtc --version`"
DTC=/var/lib/jenkins/git/dtc/dtc DTCVERSION=2.0.0 make clean
DTC=/var/lib/jenkins/git/dtc/dtc DTCVERSION=2.0.0 make all || exit 1
echo "*********************************************"