Skip to content

Commit

Permalink
Update update-pack.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
JayanaGunaweera01 authored Jun 29, 2023
1 parent e7ff685 commit 43d3f38
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/migration-tester/migration-automation/update-pack.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
#!/bin/bash

# Define colours
RED='\033[0;31m'
GREEN='\033[0;32m\033[1m'
PURPLE='\033[1;35m'
BOLD='\033[1m'
NC='\033[0m' # No Color

email=$1
password=$2
startServer=$3


# Source env file
. "/home/runner/work/product-is/product-is/.github/migration-tester/migration-automation/env.sh"
echo -e "${GREEN}==> Env file for Ubuntu sourced successfully${NC}"

# Copy update tool from utils to bin folder
cd "/home/runner/work/product-is/product-is/.github/migration-tester/utils/update-tools"

cp -r $UPDATE_TOOL_UBUNTU $BIN_ISOLD

if [ "$startServer" = "$currentVersion" ]; then
cp -r $UPDATE_TOOL_UBUNTU $BIN_ISOLD
elif [ "$startServer" = "$migratingVersion" ]; then
cp -r $UPDATE_TOOL_UBUNTU $BIN_ISNEW
fi
copy_exit_code=$?
if [ $copy_exit_code -eq 0 ]; then
echo "${GREEN}==> Update tool successfully copied to $currentVersion${RESET}"
echo "${GREEN}==> Update tool successfully copied to "$startServer"${RESET}"
else
echo "${RED}==> Failed to copy the update tool.${RESET}"
fi

cd "$BIN_ISOLD"
if [ "$startServer" = "$currentVersion" ]; then
cd "$BIN_ISOLD"
elif [ "$startServer" = "$migratingVersion" ]; then
cd "$BIN_ISNEW"
fi

sudo apt-get install expect -y

Expand Down

0 comments on commit 43d3f38

Please sign in to comment.