Browse Source

Merge "OSP-301 update build script for Train" into stable/train

stable/train
Zuul 1 month ago
committed by Gerrit Code Review
parent
commit
b53155aa34
1 changed files with 17 additions and 32 deletions
  1. +17
    -32
      build_packages/openstack_networking_bigswitch_tagged.build

+ 17
- 32
build_packages/openstack_networking_bigswitch_tagged.build View File

@ -44,7 +44,7 @@ case "$GIT_BRANCH" in
PAGE_ID="1065746454"
OSP_REL_NAME="TRAIN"
RHOSP_REL_NAME="RHOSP-16"
BOSI_BRANCH="4.7.0"
BOSI_BRANCH="6.1.0"
;;
*"stein"*)
GIT_TAG_REGEX="14.*.*"
@ -99,16 +99,7 @@ esac
# based on commit date
CURR_VERSION=`git for-each-ref refs/tags/$GIT_TAG_REGEX --sort="-*committerdate" --format="%(refname:short)" --count=1`
# fetch the tagged .tar.gz from pypi to pwd/dist directory
echo "Download tagged plugin package from PYPI"
mkdir dist
pip download networking-bigswitch==$CURR_VERSION --no-binary :all: --dest dist
echo "Building RPM packages"
DOCKER_IMAGE_RPM=$DOCKER_REGISTRY'/horizon-bsn-builder:latest'
BUILD_OS=centos7-x86_64
docker pull $DOCKER_IMAGE_RPM
BUILD_OS=centos8-x86_64
BUILDDIR=$(mktemp -d)
mkdir -p $BUILDDIR/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
@ -123,18 +114,9 @@ CHANGE_LOG=`echo "$CHANGE_LOG" | sed -E "s/[0-9]{2}:[0-9]{2}:[0-9]{2}\ //g"`
# change log can contain forward slash. so use % as delimiter for second sed expression
sed -i -e "s/\${version_number}/$CURR_VERSION/" -e "s%\${change_log}%$CHANGE_LOG%" rhel/python-networking-bigswitch.spec
cp dist/* $BUILDDIR/SOURCES/
cp rhel/*.service $BUILDDIR/SOURCES/
cp rhel/*.spec $BUILDDIR/SPECS/
cp build_packages/build-rhel-packages-inner.sh $BUILDDIR/build-rhel-packages-inner.sh
docker run -v $BUILDDIR:/rpmbuild $DOCKER_IMAGE_RPM /rpmbuild/build-rhel-packages-inner.sh
# Copy built RPMs to pkg/
BIGTOP_PARTIAL_PATH="$BUILD_OS/$GIT_BRANCH/tagged/$CURR_VERSION"
OUTDIR=$(readlink -m "pkg/$BIGTOP_PARTIAL_PATH")
rm -rf "$OUTDIR" && mkdir -p "$OUTDIR"
cp $BUILDDIR/RPMS/noarch/*.rpm "$OUTDIR"
# helper method to get version number
get_version () {
@ -145,33 +127,36 @@ get_version () {
}
# build a single tar with all plugin RPM files and yamls
# the tarball does not include networking-bigswitch
# it should be pulled as a container from Redhat registry
DATE=`date +%Y-%m-%d-%H-%M`
ALL_RPM_YAML_TAR_DIR="$RHOSP_REL_NAME-$OSP_REL_NAME-PLUGINS-$DATE"
ALL_RPM_YAML_TAR_GZ="$ALL_RPM_YAML_TAR_DIR.tar.gz"
# 1. get yamls and customize scripts from BOSI
# 1. get yamls and customize script from BOSI
mkdir bosi
rsync -e 'ssh -o "StrictHostKeyChecking no"' -uva bigtop:public_html/bosi/$BOSI_BRANCH/latest/* ./bosi
mv ./bosi/rhosp_resources/$GIT_BRANCH/yamls ./$ALL_RPM_YAML_TAR_DIR
mv ./bosi/rhosp_resources/$GIT_BRANCH/ivs/* ./$ALL_RPM_YAML_TAR_DIR
mv ./bosi/rhosp_resources/$GIT_BRANCH/ ./$ALL_RPM_YAML_TAR_DIR
# 2. get neutron-bsn-lldp *.noarch.rpm from bigtop
rsync -e 'ssh -o "StrictHostKeyChecking no"' -uva bigtop:public_html/neutron-bsn-lldp/centos7-x86_64/origin/master/latest/*.noarch.rpm ./$ALL_RPM_YAML_TAR_DIR
LLDP_PKG="`ls ./$ALL_RPM_YAML_TAR_DIR/neutron-bsn-lldp*`"
# 2. get python-arista-ccf-neutronclient*.noarch.rpm from bigtop
# master branch is the py3 version
rsync -e 'ssh -o "StrictHostKeyChecking no"' -uva bigtop:public_html/neutron-arista-ccf-lldp/centos8-x86_64/origin/master/latest/*.noarch.rpm ./$ALL_RPM_YAML_TAR_DIR
LLDP_PKG="`ls ./$ALL_RPM_YAML_TAR_DIR/neutron-arista-ccf-lldp*`"
get_version $LLDP_PKG
LLDP_VERSION=$V
echo "neutron-bsn-lldp version is" $LLDP_VERSION
echo "neutron-arista-ccf-lldp version is" $LLDP_VERSION
# 3. update startup.sh and customize.sh with neutron-bsn-lldp pkg version
# 3. update customize.sh and README with neutron-arista-ccf-lldp pkg version
sed -i -e "s/\${lldp_version}/$LLDP_VERSION/" ./$ALL_RPM_YAML_TAR_DIR/customize.sh
sed -i -e "s/\${lldp_version}/$LLDP_VERSION/" ./$ALL_RPM_YAML_TAR_DIR/startup.sh
sed -i -e "s/\${lldp_version}/$LLDP_VERSION/" ./$ALL_RPM_YAML_TAR_DIR/README
# 4. get python-bsn-neutronclient*.noarch.rpm from bigtop
rsync -e 'ssh -o "StrictHostKeyChecking no"' -uva bigtop:public_html/python-bsn-neutronclient/centos7-x86_64/$GIT_BRANCH/latest/*.noarch.rpm ./$ALL_RPM_YAML_TAR_DIR
# 4. get python-arista-ccf-neutronclient*.noarch.rpm from bigtop
# master branch is the py3 version
rsync -e 'ssh -o "StrictHostKeyChecking no"' -uva bigtop:public_html/python-arista-ccf-neutronclient/centos8-x86_64/origin/master/latest/*.noarch.rpm ./$ALL_RPM_YAML_TAR_DIR
# 5. build a tarball and put it at $OUTDIR
tar -zcvf $OUTDIR/$ALL_RPM_YAML_TAR_GZ $ALL_RPM_YAML_TAR_DIR
cp dist/*.tar.gz "$OUTDIR"
git log > "$OUTDIR/gitlog.txt"
touch "$OUTDIR/build-$CURR_VERSION"
ln -snf $(basename $OUTDIR) $OUTDIR/../latest


Loading…
Cancel
Save