mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-21 18:50:28 +00:00
Merge pull request #89 from tingtli/master
update buildcore.sh and builddep.sh to upload the build to xcat.org
This commit is contained in:
@@ -11,18 +11,18 @@
|
||||
# uploaded to in sourceforge (e.g. devel, or 2.3).
|
||||
# - You probably also want to put root's pub key from the build machine onto sourceforge for
|
||||
# the upload user listed below, so you don't have to keep entering pw's. You can do this
|
||||
# at https://sourceforge.net/account/ssh
|
||||
# at https://xcat.org/setting/ssh
|
||||
# - make sure reprepro is installed on the build machine
|
||||
# - Run this script from the local svn repository you just created. It will create the other directories that are needed.
|
||||
|
||||
# Usage: attr=value attr=value ... ./build-ubunturepo { -c | -d }
|
||||
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not
|
||||
# actually build xcat, just uploads the most recent snap build to https://sourceforge.net/projects/xcat/files/xcat/ .
|
||||
# If not specified, a snap build is assumed, which uploads to https://sourceforge.net/projects/xcat/files/yum/
|
||||
# or https://sourceforge.net/projects/xcat/files/aix/.
|
||||
# actually build xcat, just uploads the most recent snap build to http://xcat.org/files/xcat/ .
|
||||
# If not specified, a snap build is assumed, which uploads to https://xcat.org/files/yum/
|
||||
# or https://xcat.org/files/aix/.
|
||||
# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this build is
|
||||
# a GA candidate build, not to be released yet. This will result in the tarball being uploaded to
|
||||
# https://sourceforge.net/projects/xcat/files/yum/ or https://sourceforge.net/projects/xcat/files/aix/
|
||||
# http://xcat.org/files/yum/ or http://xcat.org/files/aix/
|
||||
# (but the tarball file name will be like a released tarball, not a snap build). When you are ready to
|
||||
# release this build, use PROMOTE=1 without PREGA
|
||||
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
|
||||
@@ -93,6 +93,9 @@ fi
|
||||
|
||||
|
||||
uploader="litingt"
|
||||
user="xcat"
|
||||
target_machine="xcat.org"
|
||||
release="github.com/xcat2/xcat-core/releases"
|
||||
# Find where this script is located to set some build variables
|
||||
old_pwd=`pwd`
|
||||
cd `dirname $0`
|
||||
@@ -104,8 +107,8 @@ local_dep_repo_path="$curdir/../../xcat-dep/xcat-dep"
|
||||
|
||||
#define the url used for creating the source list file
|
||||
#define the upload dir used for uploading packages
|
||||
sf_repo_url="https://sourceforge.net/projects/xcat/files/ubuntu"
|
||||
sf_dir="/home/frs/project/x/xc/xcat"
|
||||
sf_repo_url="https://xcat.org/files/ubuntu"
|
||||
sf_dir="/var/www/xcat.org/files"
|
||||
|
||||
#use flock to only one person build at the same time
|
||||
# Get a lock, so can not do 2 builds at once
|
||||
@@ -367,22 +370,28 @@ __EOF__
|
||||
if [ "$REL" = "devel" -o "$PREGA" != 1 ]; then
|
||||
i=0
|
||||
echo "Uploading RPMs from $upload_dir to ${sf_dir}/ubuntu/${REL}/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $upload_dir ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/${REL}/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $upload_dir $user@$target_machine:${sf_dir}/ubuntu/${REL}/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
#upload the tar ball
|
||||
#for the GA build, upload to https://sourceforge.net/projects/xcat/files/xcat/<version>.x_Ubuntu/
|
||||
#for other scenario, upload to https://sourceforge.net/projects/xcat/files/ubuntu/<version>
|
||||
#for the GA build, upload to http://xcat.org/files/xcat/<version>.x_Ubuntu/ and https://github.com/xcat2/xcat-core/releases
|
||||
#for other scenario, upload to http://xcat.org/files/ubuntu/<version>
|
||||
if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then
|
||||
i=0
|
||||
echo "Uploading $tar_name to ${sf_dir}/xcat/${REL}.x_Ubuntu/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $tar_name ${uploader},xcat@web.sourceforge.net:${sf_dir}/xcat/${REL}.x_Ubuntu/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v --force $tar_name $user@$target_machine:${sf_dir}/xcat/${REL}.x_Ubuntu/
|
||||
do : ; done
|
||||
|
||||
#at the same time upload the GA build to github.
|
||||
i=0
|
||||
echo "Uploading $tar_name to https://github.com/xcat2/xcat-core/releases ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v --force $tar_name $uploader@$release/
|
||||
do : ; done
|
||||
else
|
||||
i=0
|
||||
echo "Uploading $tar_name to ${sf_dir}/ubuntu/${REL}/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $tar_name ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/${REL}/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v --force $tar_name $user@$target_machine:${sf_dir}/ubuntu/${REL}/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
@@ -501,19 +510,19 @@ __EOF__
|
||||
#upload the dep packages
|
||||
i=0
|
||||
echo "Uploading debs from xcat-dep to ${sf_dir}/ubuntu/xcat-dep/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete xcat-dep ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/
|
||||
do : ; done
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete xcat-dep $user@$target_machine:${sf_dir}/ubuntu/
|
||||
do : ; done
|
||||
#upload the tarball
|
||||
i=0
|
||||
echo "Uploading $dep_tar_name to ${sf_dir}/xcat-dep/2.x_Ubuntu/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $dep_tar_name ${uploader},xcat@web.sourceforge.net:${sf_dir}/xcat-dep/2.x_Ubuntu/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v --force $dep_tar_name $user@$target_machine:${sf_dir}/xcat-dep/2.x_Ubuntu/
|
||||
do : ; done
|
||||
|
||||
#upload the README file
|
||||
cd debs
|
||||
i=0
|
||||
echo "Uploading README to ${sf_dir}/xcat-dep/2.x_Ubuntu/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v README ${uploader},xcat@web.sourceforge.net:${sf_dir}/xcat-dep/2.x_Ubuntu/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v --force README $user@$targe_machine:${sf_dir}/xcat-dep/2.x_Ubuntu/
|
||||
do : ; done
|
||||
|
||||
cd $old_pwd
|
||||
|
88
buildcore.sh
88
buildcore.sh
@@ -4,12 +4,9 @@
|
||||
# Build and upload the xcat-core code, on either linux or aix.
|
||||
|
||||
# Getting Started:
|
||||
# - Check out the xcat-core svn repository (either the trunk or a branch) into
|
||||
# - Check out the xcat-core github repository (either the trunk or a branch) into
|
||||
# a dir called <rel>/src/xcat-core, where <rel> is the same as the release dir it will be
|
||||
# uploaded to in sourceforge (e.g. devel, or 2.3).
|
||||
# - You probably also want to put root's pub key from the build machine onto sourceforge for
|
||||
# the upload user listed below, so you don't have to keep entering pw's. You can do this
|
||||
# at https://sourceforge.net/account/ssh
|
||||
# uploaded to in xcat.org (e.g. devel, or 2.3).
|
||||
# - On Linux: make sure createrepo is installed on the build machine
|
||||
# - On AIX: Install openssl and openssh installp pkgs and run updtvpkg. Install from http://www.perzl.org/aix/ :
|
||||
# apr, apr-util, bash, bzip2, db4, expat, gdbm, gettext, glib2, gmp, info, libidn, neon, openssl (won't
|
||||
@@ -22,12 +19,12 @@
|
||||
# Usage: buildcore.sh [attr=value attr=value ...]
|
||||
# Before running buildcore.sh, you must change the local git repo to the branch you want built, using: git checkout <branch>
|
||||
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not actually build
|
||||
# xcat, just uploads the most recent snap build to https://sourceforge.net/projects/xcat/files/xcat/ .
|
||||
# If not specified, a snap build is assumed, which uploads to https://sourceforge.net/projects/xcat/files/yum/
|
||||
# or https://sourceforge.net/projects/xcat/files/aix/.
|
||||
# xcat, just uploads the most recent snap build to http://xcat.org/files/xcat/ .
|
||||
# If not specified, a snap build is assumed, which uploads to http://xcat.org/files/yum/
|
||||
# or http//xcat.org/files/aix/.
|
||||
# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this build is
|
||||
# a GA candidate build, not to be released yet. This will result in the tarball being uploaded to
|
||||
# https://sourceforge.net/projects/xcat/files/yum/ or https://sourceforge.net/projects/xcat/files/aix/
|
||||
# http://xcar.org/files/yum/ or http://xcat.org/files/aix/
|
||||
# (but the tarball file name will be like a released tarball, not a snap build). When you are ready to
|
||||
# release this build, use PROMOTE=1 without PREGA
|
||||
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
|
||||
@@ -41,7 +38,10 @@
|
||||
|
||||
# you can change this if you need to
|
||||
UPLOADUSER=litingt
|
||||
FRS=/home/frs/project/x/xc/xcat
|
||||
USER=xcat
|
||||
FRS=/var/www/xcat.org/files
|
||||
TARGET_MACHINE=xcat.org
|
||||
RELEASE=github.com/xcat2/xcat-core/releases
|
||||
|
||||
if [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
|
||||
echo "Usage:"
|
||||
@@ -128,7 +128,7 @@ if [ "$REL" = "xcat-core" ]; then # using git
|
||||
fi
|
||||
|
||||
YUMDIR=$FRS
|
||||
YUMREPOURL="https://sourceforge.net/projects/xcat/files/yum"
|
||||
YUMREPOURL="http://xcat.org/files/yum"
|
||||
|
||||
# Set variables based on which type of build we are doing
|
||||
if [ -n "$EMBED" ]; then
|
||||
@@ -535,7 +535,7 @@ if [ -n "$UP" ] && [ "$UP" == 0 ]; then
|
||||
fi
|
||||
#else we will continue
|
||||
|
||||
# Upload the individual RPMs to sourceforge
|
||||
# Upload the individual RPMs to xcat.org
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
YUM=aix
|
||||
else
|
||||
@@ -547,51 +547,57 @@ fi
|
||||
if [ "$REL" = "devel" -o "$PREGA" != 1 ]; then
|
||||
i=0
|
||||
echo "Uploading RPMs from $CORE to $YUMDIR/$YUM/$REL$EMBEDDIR/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $CORE $UPLOADUSER,xcat@web.sourceforge.net:$YUMDIR/$YUM/$REL$EMBEDDIR/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $CORE $USER@$TARGET_MACHINE:$YUMDIR/$YUM/$REL$EMBEDDIR/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
# Upload the individual source RPMs to sourceforge
|
||||
# Upload the individual source RPMs to xcat.org
|
||||
i=0
|
||||
echo "Uploading src RPMs from $SRCD to $YUMDIR/$YUM/$REL$EMBEDDIR/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $SRCD $UPLOADUSER,xcat@web.sourceforge.net:$YUMDIR/$YUM/$REL$EMBEDDIR/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $SRCD $USER@$TARGET_MACHINE:$YUMDIR/$YUM/$REL$EMBEDDIR/
|
||||
do : ; done
|
||||
|
||||
# Upload the tarball to sourceforge
|
||||
# Upload the tarball to xcat.org
|
||||
if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then
|
||||
# upload tarball to FRS area
|
||||
i=0
|
||||
echo "Uploading $TARNAME to $FRS/xcat/$REL.x_$OSNAME$EMBEDDIR/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $TARNAME $UPLOADUSER,xcat@web.sourceforge.net:$FRS/xcat/$REL.x_$OSNAME$EMBEDDIR/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v --force $TARNAME $USER@$TARGET_MACHINE:$FRS/xcat/$REL.x_$OSNAME$EMBEDDIR/
|
||||
do : ; done
|
||||
|
||||
# upload tarball to github when we release the build.
|
||||
i=0
|
||||
echo "Uploading $TARNAME to https://github.com/xcat2/xcat-core/releases ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v --force $TARNAME $UPLOADUSER@$RELEASE/
|
||||
do : ; done
|
||||
else
|
||||
i=0
|
||||
echo "Uploading $TARNAME to $YUMDIR/$YUM/$REL$EMBEDDIR/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $TARNAME $UPLOADUSER,xcat@web.sourceforge.net:$YUMDIR/$YUM/$REL$EMBEDDIR/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v --force $TARNAME $USER@$TARGET_MACHINE:$YUMDIR/$YUM/$REL$EMBEDDIR/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
# Extract and upload the man pages in html format
|
||||
if [ "$OSNAME" != "AIX" -a "$REL" = "devel" -a "$PROMOTE" != 1 -a -z "$EMBED" ]; then
|
||||
echo "Extracting and uploading man pages to htdocs/ ..."
|
||||
mkdir -p man
|
||||
cd man
|
||||
rm -rf opt
|
||||
rpm2cpio ../$XCATCORE/xCAT-client-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
rpm2cpio ../$XCATCORE/perl-xCAT-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
rpm2cpio ../$XCATCORE/xCAT-test-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
rpm2cpio ../$XCATCORE/xCAT-buildkit-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
#rpm2cpio ../$XCATCORE/xCAT-OpenStack-*.x86_64.rpm | cpio -id '*.html'
|
||||
rpm2cpio ../$XCATCORE/xCAT-SoftLayer-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
rpm2cpio ../$XCATCORE/xCAT-vlan-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
i=0
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag -r opt/xcat/share/doc/man1 opt/xcat/share/doc/man3 opt/xcat/share/doc/man5 opt/xcat/share/doc/man7 opt/xcat/share/doc/man8 $UPLOADUSER,xcat@web.sourceforge.net:htdocs/
|
||||
do : ; done
|
||||
|
||||
# extract and upload the tools readme
|
||||
rpm2cpio ../$XCATCORE/xCAT-server-*.$NOARCH.rpm | cpio -id ./opt/xcat/share/xcat/tools/README.html
|
||||
i=0
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag opt/xcat/share/xcat/tools/README.html $UPLOADUSER,xcat@web.sourceforge.net:htdocs/tools/
|
||||
do : ; done
|
||||
cd ..
|
||||
fi
|
||||
#if [ "$OSNAME" != "AIX" -a "$REL" = "devel" -a "$PROMOTE" != 1 -a -z "$EMBED" ]; then
|
||||
# echo "Extracting and uploading man pages to htdocs/ ..."
|
||||
# mkdir -p man
|
||||
# cd man
|
||||
# rm -rf opt
|
||||
# rpm2cpio ../$XCATCORE/xCAT-client-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
# rpm2cpio ../$XCATCORE/perl-xCAT-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
# rpm2cpio ../$XCATCORE/xCAT-test-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
# rpm2cpio ../$XCATCORE/xCAT-buildkit-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
# #rpm2cpio ../$XCATCORE/xCAT-OpenStack-*.x86_64.rpm | cpio -id '*.html'
|
||||
# rpm2cpio ../$XCATCORE/xCAT-SoftLayer-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
# rpm2cpio ../$XCATCORE/xCAT-vlan-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
# i=0
|
||||
# while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag -r opt/xcat/share/doc/man1 opt/xcat/share/doc/man3 opt/xcat/share/doc/man5 opt/xcat/share/doc/man7 opt/xcat/share/doc/man8 $UPLOADUSER,xcat@web.sourceforge.net:htdocs/
|
||||
# do : ; done
|
||||
#
|
||||
# # extract and upload the tools readme
|
||||
# rpm2cpio ../$XCATCORE/xCAT-server-*.$NOARCH.rpm | cpio -id ./opt/xcat/share/xcat/tools/README.html
|
||||
# i=0
|
||||
# while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag opt/xcat/share/xcat/tools/README.html $UPLOADUSER,xcat@web.sourceforge.net:htdocs/tools/
|
||||
# do : ; done
|
||||
# cd ..
|
||||
#fi
|
||||
|
21
builddep.sh
21
builddep.sh
@@ -5,11 +5,7 @@
|
||||
# all relevant architectures from the src & spec files in svn.
|
||||
|
||||
# When running this script to package xcat-dep:
|
||||
# - You need to install gsa-client on the build machine.
|
||||
# - You probably want to put root's pub key from the build machine onto sourceforge for
|
||||
# the upload user listed below, so you don't have to keep entering pw's. You can do this
|
||||
# at https://sourceforge.net/account/ssh
|
||||
# - Also make sure createrepo is installed on the build machine
|
||||
# - Make sure createrepo is installed on the build machine
|
||||
|
||||
# Usage: builddep.sh [attr=value attr=value ...]
|
||||
# DESTDIR=<dir> - the dir to place the dep tarball in. The default is ../../../xcat-dep, relative
|
||||
@@ -19,9 +15,10 @@
|
||||
# VERBOSE=1 - to see lots of verbose output
|
||||
|
||||
# you can change this if you need to
|
||||
UPLOADUSER=litingt
|
||||
USER=xcat
|
||||
TARGET_MACHINE=xcat.org
|
||||
|
||||
FRS=/home/frs/project/x/xc/xcat
|
||||
FRS=/var/www/xcat.org/files
|
||||
OSNAME=$(uname)
|
||||
|
||||
# Process cmd line variable assignments, assigning each attr=val pair to a variable of same name
|
||||
@@ -43,8 +40,8 @@ else
|
||||
fi
|
||||
|
||||
# this is needed only when we are transitioning the yum over to frs
|
||||
YUMREPOURL1="http://xcat.sourceforge.net/yum"
|
||||
YUMREPOURL2="https://sourceforge.net/projects/xcat/files/yum"
|
||||
YUMREPOURL1="http://xcat.org/yum"
|
||||
YUMREPOURL2="http://xcat.org/files/yum"
|
||||
if [ "$FRSYUM" != 0 ]; then
|
||||
YUMDIR=$FRS
|
||||
YUMREPOURL="$YUMREPOURL2"
|
||||
@@ -252,13 +249,13 @@ else
|
||||
links="-l"
|
||||
fi
|
||||
echo "Uploading RPMs from xcat-dep to $YUMDIR/$YUM/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $links -ruv --delete xcat-dep $UPLOADUSER,xcat@web.sourceforge.net:$YUMDIR/$YUM/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $links -ruv --delete xcat-dep $USER@$TARGET_MACHINE:$YUMDIR/$YUM/
|
||||
do : ; done
|
||||
|
||||
# Upload the tarball to the SF FRS Area
|
||||
i=0
|
||||
echo "Uploading $DFNAME to $FRS/xcat-dep/$FRSDIR/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $DFNAME $UPLOADUSER,xcat@web.sourceforge.net:$FRS/xcat-dep/$FRSDIR/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $DFNAME $USER@$TARGET_MACHINE:$FRS/xcat-dep/$FRSDIR/
|
||||
do : ; done
|
||||
|
||||
# Upload the README to the SF FRS Area
|
||||
@@ -268,6 +265,6 @@ sed "6 iThe latest xcat-dep tar ball is ${DFNAME}" -i README
|
||||
|
||||
i=0
|
||||
echo "Uploading README to $FRS/xcat-dep/$FRSDIR/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v README $UPLOADUSER,xcat@web.sourceforge.net:$FRS/xcat-dep/$FRSDIR/
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v README $USER@$TARGET_MACHINE:$FRS/xcat-dep/$FRSDIR/
|
||||
do : ; done
|
||||
|
||||
|
Reference in New Issue
Block a user