Skip to content

Commit

Permalink
Per #1541, update met_checkout_and_build.sh and met_build.sh to proce…
Browse files Browse the repository at this point in the history
…ss tags named vX.Y instead of met-X.Y. Also have checkout_and_build call met_build from the SAME directory.
  • Loading branch information
JohnHalleyGotway committed Oct 28, 2020
1 parent 168f73a commit 3969773
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
25 changes: 13 additions & 12 deletions scripts/met_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
# This script is called by the
# MET_checkout_and_build.sh script.
#
# The desired version of the code must have alredy
# been checked out prior to calling this script.
# The desired version of the code must have
# already been checked out prior to calling this
# script.
#
# Usage: MET_build <version_number>
#
Expand Down Expand Up @@ -38,27 +39,27 @@ fi

# Check for 0 or 1 arguments
if [ ${NARGS} -eq 0 ]; then
VERSION="met-${CUR_REV}"
VERSION="${CUR_REV}"
elif [ ${NARGS} -eq 1 ]; then
VERSION="met-${1}"
VERSION="${1}"
else
echo
echo "USAGE: MET_build <version_number>"
echo
exit 1
fi

# Set the MET build version by stripping off leading "v" from "vX.Y"
export MET_BUILD_VERSION=`echo $VERSION | sed 's/v//g'`
echo "Building MET version '${MET_BUILD_VERSION}'"

# Copy the current met directory
cp -r met ${VERSION}
cd ${VERSION}
cp -r met met-${MET_BUILD_VERSION}
cd met-${MET_BUILD_VERSION}

# Cleanup
rm -f `find ./ -name ".gitignore"`

# Set the MET build version for bootstrap by stripping off leading "met-"
export MET_BUILD_VERSION=`echo $VERSION | sed 's/met-//g'`
echo "Building MET version '${MET_BUILD_VERSION}'"

# Run the bootstrap program to prepare for running configure
echo "Running 'bootstrap' to prepare for running configure"
./bootstrap > /dev/null
Expand Down Expand Up @@ -100,8 +101,8 @@ make dist > /dev/null

# Construct the desired name for the tar file. autoconf
# creates the tar file using it's standard naming convention.
TAR_FILE="${VERSION}.${DATE}.tar.gz"
TAR_FILE="met-${MET_BUILD_VERSION}.${DATE}.tar.gz"

echo "Copying tar file to new name: '${TAR_FILE}'"
echo "Moving tar file to new name: '${TAR_FILE}'"
mv met-* ../${TAR_FILE}

17 changes: 12 additions & 5 deletions scripts/met_checkout_and_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,20 @@ run_command() {
return ${STATUS}
}

# Run svn info to update contents of version.txt
# Use the Git info to update the contents of version.txt
get_git_info() {
echo "CALLING: git config, git rev-parse, and git log"
git config --get remote.origin.url | sed -r 's/^/Repository:\t\t/g' > met/data/version.txt
git rev-parse --short HEAD | sed -r 's/^/Last Changed Rev:\t/g' >> met/data/version.txt
git log -1 --format=%cd met | sed -r 's/^/Last Changed Date:\t/g' >> met/data/version.txt
}

# Store the path the current script being run
SCRIPT_DIR=`dirname $0`
if [[ ${SCRIPT_DIR:0:1} != "/" ]]; then
SCRIPT_DIR=`pwd`/${SCRIPT_DIR}
fi

# Clone repo into a working directory
mkdir build; cd build
git clone ${GIT_REPO}
Expand Down Expand Up @@ -142,18 +148,19 @@ else
exit 1
fi

# Check that the met_build.sh script exists
if [[ ! -e "scripts/met_build.sh" ]]; then
# Check that the met_build.sh script exists in the same
# directory as the met_checkout_and_build script
if [[ ! -e "${SCRIPT_DIR}/met_build.sh" ]]; then

echo
echo "ERROR: scripts/met_build.sh does not exist!"
echo "ERROR: ${SCRIPT_DIR}/met_build.sh script does not exist!"
echo
exit 1

fi

# Call the build script to build the release
run_command "scripts/met_build.sh ${BUILD_ARGS}"
run_command "${SCRIPT_DIR}/met_build.sh ${BUILD_ARGS}"
run_command "mv *.tar.gz ../../."
run_command "cd ../.."
run_command "rm -rf build"

0 comments on commit 3969773

Please sign in to comment.