summaryrefslogtreecommitdiff
path: root/hudson.sh
blob: c4e579fbacce941902a4521bff1734f05909fa96 (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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
 
#####################################################################
##
## Please set parameter value.
##
#####################################################################
git_name=ide-plugin-codecoverage
git_repo_path=/slp/sdk/da
 
 
#####################################################################
##
## Do not touch here.
##
#####################################################################
 
build_path=`pwd`
git_user=slp-git
target_eclipse_parent_path=/var/lib/hudson
git_repo_ide_path=/slp/sdk/ide
fresh_ide_git_name=fresh-ide
build()
{
	echo "Platform : ${platform}"
	if [ "x${platform}" = "x" ]
	then
		echo "ERROR : Please set \"platform\" value."
		exit 1
	fi
 
	echo "target eclipse : ${target_eclipse}"
	if [ "x${target_eclipse}" = "x" ]
	then
		echo "ERROR : Please set \"target_eclipse\" value."
		exit 1
	fi
 
	echo "Getting ${target_eclipse} from git repository..."
	cd ${target_eclipse_parent_path}
	if [ -d ${target_eclipse_parent_path}/${target_eclipse} ]
	then
		cd ${target_eclipse_parent_path}/${target_eclipse}
		git pull
	else
		cd ${target_eclipse_parent_path}
		git clone ${git_user}:${git_repo_ide_path}/${target_eclipse} 2>&1
	fi
 
	if [ $? != 0 ]
	then
		echo "ERROR : Connect to git repository failed..."
		exit 1
	fi
 
	echo "Getting ${git_name} from git repository..."
	cd ${build_path}
	if [ -d ${git_name} ]
	then
		rm -rf ${git_name}
	fi
	git clone ${git_user}:${git_repo_path}/${git_name} 2>&1
 
	echo "BUILD START"
	cd ${build_path}/${git_name}
	./build.sh ${platform} ${target_eclipse_parent_path}/${target_eclipse}/eclipse 2>&1
 
	if [ $? != 0 ]
	then
		echo "ERROR : Build Failed..."
		exit 1
	fi
}
 
package_and_upload()
{
	echo "PACKAGING START"
	cd ${build_path}/${git_name}
	echo ===========================================================================
	echo ${platform}
	echo `pwd`
	echo ${build_path}/
	echo ===========================================================================

	case ${platform} in
		linux)
			build_result_path=${build_path}/build_result/N.code_coverage_build/linux.gtk.x86/codecoverage
			;;
		windows)
			build_result_path=${build_path}/build_result/N.code_coverage_build/win32.win32.x86/codecoverage
			;;
	esac

 	./package.sh ${platform} ${build_result_path} ${BUILD_NUMBER}
}
 
build_package_upload_windows_version()
{
	platform=windows
	target_eclipse=fresh-ide-winpde
	build
	package_and_upload
}
build_package_upload_linux_version()
{
	platform=linux
	target_eclipse=fresh-ide-pde
	build
	package_and_upload
}
 
build_package_upload_linux_version
build_package_upload_windows_version