Skip to content

Commit

Permalink
Minimize number of parameters needed to set version string
Browse files Browse the repository at this point in the history
  • Loading branch information
sumatej committed Jun 29, 2021
1 parent f7b05bd commit afa92d4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ set -e

# Set default values for the following variables if they're not already set.
NUAGE_OSPD_RELEASE="${NUAGE_OSPD_RELEASE:-16.0}"
NUAGE_PROJECT="${NUAGE_PROJECT:-0}"
NUAGE_BUILD_RELEASE="${NUAGE_BUILD_RELEASE:-0}"
NUAGE_BUILD_NUMBER="${NUAGE_BUILD_NUMBER:-0}"
NUAGE_RELEASE="${NUAGE_RELEASE:-0.0.0_0}"

# $GIT_DIR should be the base directory of the git tree. Since that's where the
# script is, we can locate the git tree based on that.
Expand All @@ -23,8 +21,6 @@ tar -czf $WORKSPACE/rpmbuild/SOURCES/nuage-tripleo-heat-templates.tar.gz -C $GIT
version="${NUAGE_OSPD_RELEASE}"
sed "s/@VERSION@/$version/" $GIT_DIR/nuage-tripleo-heat-templates.spec.in > $WORKSPACE/rpmbuild/SPECS/nuage-tripleo-heat-templates.spec

release="${NUAGE_PROJECT}.${NUAGE_BUILD_RELEASE}_${NUAGE_BUILD_NUMBER}"

# build the rpm
cd $WORKSPACE/rpmbuild
rpmbuild --define "_topdir $WORKSPACE/rpmbuild" -ba SPECS/nuage-tripleo-heat-templates.spec --define "release $release"
rpmbuild --define "_topdir $WORKSPACE/rpmbuild" -ba SPECS/nuage-tripleo-heat-templates.spec --define "release $NUAGE_RELEASE"

0 comments on commit afa92d4

Please sign in to comment.