Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the oudated release script #6801

Merged
merged 9 commits into from
May 23, 2023
29 changes: 22 additions & 7 deletions scripts/release-bit-verification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,32 @@
#
# Example: ./release-bit-verification.sh ~/Downloads/odo-redistributable-2.4.3-1.el8.x86_64.rpm
#
#For erroring out in case of error
set -eo pipefail

shout() {
echo "--------------------------------$1------------------------------------------"
}
# Check SHASUM for all the binary files and there should be no difference



# Create a Temp directory
ritudes marked this conversation as resolved.
Show resolved Hide resolved
if [ "$#" -lt 1 ]
then
echo "No arguments supplied"
exit 1
fi

WORKING_DIR=$(mktemp -d)
shout "WORKING_DIR=$WORKING_DIR"
export REPO_URL=${REPO_URL:-"https://github.com/redhat-developer/odo.git"}
if [ -f ${1} ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would still create the temporary directory if the file is not valid.
I'd suggest inverting the condition: exit if the file does not exist, without even creating the temporary directory.

Once all checks are done on the first argument, we can proceed with creating the temporary directory.

then
shout "WORKING_DIR=$WORKING_DIR"
export REPO_URL=${REPO_URL:-"https://github.com/redhat-developer/odo.git"}
else
echo "Please enter a valid filepath";
exit 1
fi

# Extract from rpm file
rpm2cpio ${1} | cpio -idmvD $WORKING_DIR
Expand Down Expand Up @@ -67,10 +83,9 @@ fi
git clone $REPO_URL odo && cd $WORKING_DIR/odo && git checkout "v$VERSION"

#Run tests
make test-integration-devfile
make test-integration
make test-e2e-all
make test-cmd-project
make test-e2e

# Cleanup
rm -rf /tmp/odo /tmp/usr
rm -rf "$WORKING_DIR"