Author SHA1 Message Date
jenkins 19ae86559a Fix manifest file location 2012-03-10 22:31:47 +00:00
jenkins c6533ce424 Fix the jenkins hack 2012-03-08 20:48:55 +00:00
jenkins 018a9552df Fix to the hack :P 2012-03-07 11:51:26 +00:00
jenkins 045b88de76 Hack for Jenkins gvm_build script 2012-03-07 11:47:15 +00:00
jenkins d7179e0350 For new jenkins build system 2012-03-07 10:40:19 +00:00
jenkins 211491990c Run tests 2012-03-03 07:18:06 +00:00
jenkins b9e6b02e38 Jenkins needs this for now... 2012-03-03 05:02:04 +00:00
jenkins b1e504374a Hard code stuff for Jenkins 2012-03-03 05:00:51 +00:00
2 changed files with 33 additions and 31 deletions
+1
View File
@@ -1,3 +1,4 @@
pkgs/
*~
go
gos/
+32 -31
View File
@@ -1,4 +1,14 @@
#!/bin/bash
gpkg build $1 || exit 1
VERSION=`cat VERSION`
if [ "$VERSION" == "" ]; then
VERSION=0.0
fi
BUILD=$VERSION.$BUILD_NUMBER
mkdir -p $GVM_ROOT/pkgs/pkg.gvm/$1/current
cp $GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/pkg.gvm/$1/$BUILD/manifest $GVM_ROOT/pkgs/pkg.gvm/$1/current/manifest
exit 0
. $GVM_ROOT/scripts/functions
show_usage() {
@@ -18,39 +28,15 @@ function read_command_line() {
package_name=$1
sources=`cat $GVM_ROOT/config/sources`
shift
for i in $*; do
case $i in
-v=*|--version=*)
version=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
;;
-s=*|--source=*)
source=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
sources=`echo $i | sed 's/[-a-zA-Z0-9]*=//' && echo $sources`
;;
-a|--all)
all_deps="true"
;;
-h|--help*)
show_usage
exit 0
;;
--strict)
strict="true"
;;
*)
echo "Invalid option $i"
show_usage
exit 65 # Bad arguments
;;
esac
done
version=$1
strict="true"
gvm_go_path=$GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name
cache_dir=$GVM_ROOT/archive/package/$package_name
tmp_dir=$GVM_ROOT/tmp/$$
source_dir=$tmp_dir/$package_name/src/$package_name
build_dir=$tmp_dir/$package_name/build
# TODO: Remove hack after change to gvm_build
mkdir -p $GVM_ROOT/pkgs/pkg.gvm/$package_name/current
}
function download_package() {
@@ -58,9 +44,9 @@ function download_package() {
cd $cache_dir && git pull &> /dev/null
return
fi
#echo "Downloading $package_name..."
echo "Downloading $package_name..."
for source in $sources; do
#echo "Trying $source"
echo "Trying $source"
git clone $source/$package_name $cache_dir > /dev/null 2>&1
if [ "$?" == "0" ]; then
echo $source > $cache_dir/GVM_SOURCE
@@ -78,12 +64,13 @@ function update_package_cache() {
function copy_tmp_source() {
rm -rf $source_dir
if [ "$version" != "" ]; then
echo "Checking out $version"
git clone $cache_dir $source_dir > /dev/null 2>&1
cd $source_dir && git checkout $version > /dev/null 2>&1 ||
return 1
else
git clone $cache_dir $source_dir > /dev/null 2>&1
fi
fi
cd $source_dir
git describe --exact-match > /dev/null 2>&1
@@ -169,6 +156,13 @@ function build_package() {
cat "$build_dir/build.log"
exit 1
fi
echo "Running tests..."
cd $source_dir && gvmake test >> $build_dir/build.log 2>&1
if [ $? -ne 0 ]; then
echo "ERROR: Failed tests"
cat "$build_dir/build.log"
exit 1
fi
}
function install_package() {
@@ -214,5 +208,12 @@ check_deps
copy_source
build_package
install_package
if [ "$GPKG_PUSH_TAG" == "true" ]; then
echo "Pushing tag $BUILD_NUMBER"
cd $WORKSPACE && git tag $BUILD_NUMBER && git push origin $BUILD_NUMBER ||
display_error "Failed to push version tag"
fi
# TODO: Remove after change to gvm_build
cp $build_dir/manifest $GVM_ROOT/pkgs/pkg.gvm/$package_name/current
cleanup