diff --git a/.github/migration-tester/README.md b/.github/migration-tester/README.md index 8f4eca6504c..624d5877b4f 100644 --- a/.github/migration-tester/README.md +++ b/.github/migration-tester/README.md @@ -9,7 +9,8 @@ Welcome to Automating-Product-Migration-Testing! This project aims to automate t Click on the badge above to view the current status of the main migration workflow. The workflow ensures seamless execution of the migration client tests across various infrastructure combinations, including different databases and operating systems. - +## Notion User Guide +https://www.notion.so/User-Guide-Of-Product-Migration-Testing-Automation-Feature-17676cd5205a49a898d6527a03347199?pvs=4 ## Directory Structure diff --git a/.github/migration-tester/documents/A Guide to Download Files from Google Drive with OAuth 2.0 Using A Service Account Key.docx b/.github/migration-tester/documents/A Guide to Download Files from Google Drive with OAuth 2.0 Using A Service Account Key.docx new file mode 100644 index 00000000000..add975bbd98 Binary files /dev/null and b/.github/migration-tester/documents/A Guide to Download Files from Google Drive with OAuth 2.0 Using A Service Account Key.docx differ diff --git a/.github/migration-tester/documents/A Guide to Download Files from Google Drive with OAuth 2.0 Using A Service Account Key.pdf b/.github/migration-tester/documents/A Guide to Download Files from Google Drive with OAuth 2.0 Using A Service Account Key.pdf new file mode 100644 index 00000000000..7208fb486ff Binary files /dev/null and b/.github/migration-tester/documents/A Guide to Download Files from Google Drive with OAuth 2.0 Using A Service Account Key.pdf differ diff --git a/.github/migration-tester/documents/User Guide - Automating Product Migration Testing Feature.docx b/.github/migration-tester/documents/User Guide - Automating Product Migration Testing Feature.docx new file mode 100644 index 00000000000..edd591d18e1 Binary files /dev/null and b/.github/migration-tester/documents/User Guide - Automating Product Migration Testing Feature.docx differ diff --git a/.github/migration-tester/documents/User Guide - Automating Product Migration Testing Feature.pdf b/.github/migration-tester/documents/User Guide - Automating Product Migration Testing Feature.pdf new file mode 100644 index 00000000000..a364df6200f Binary files /dev/null and b/.github/migration-tester/documents/User Guide - Automating Product Migration Testing Feature.pdf differ diff --git a/.github/migration-tester/migration-automation/download-GA-pack.sh b/.github/migration-tester/migration-automation/download-GA-pack.sh new file mode 100644 index 00000000000..239066c7e50 --- /dev/null +++ b/.github/migration-tester/migration-automation/download-GA-pack.sh @@ -0,0 +1,144 @@ +#!/bin/bash + +# Define color variables +GREEN='\033[0;32m\033[1m' # green color +RED='\033[0;31m\033[1m' # red color +NC='\033[0m' # reset color + +# Get the value of the inputs +os=$2 +downloadingISVersion=$3 +startServer=$4 + +# Setup file and path based on OS +if [ "$os" = "ubuntu-latest" ]; then + cd "/home/runner/work/product-is/product-is/.github/migration-tester/migration-automation" + chmod +x env.sh + . ./env.sh + echo "${GREEN}==> Env file for Ubuntu sourced successfully${NC}" + + if [ "$startServer" = "current" ]; then + cd "$IS_HOME_OLD" + echo "${GREEN}==> Navigated to newly created directory to download GA pack $downloadingISVersion ${NC}" + elif [ "$startServer" = "migrating" ]; then + cd "$IS_HOME_NEW" + echo "${GREEN}==> Navigated to newly created directory to download GA pack $downloadingISVersion ${NC}" + fi + +elif [ "$os" = "macos-latest" ]; then + cd "/Users/runner/work/product-is/product-is/.github/migration-tester/migration-automation" + chmod +x env.sh + source ./env.sh + echo "${GREEN}==> Env file for Mac sourced successfully${NC}" + + if [ "$startServer" = "current" ]; then + cd "$IS_HOME_OLD_MAC" + echo "${GREEN}==> Navigated to newly created directory to download GA pack $downloadingISVersion ${NC}" + elif [ "$startServer" = "migrating" ]; then + cd "$IS_HOME_NEW_MAC" + echo "${GREEN}==> Navigated to newly created directory to download GA pack $downloadingISVersion ${NC}" + fi +fi + +# Initialize file_id variable +file_id="" + +# Check the value of IS version and assign the corresponding environment variable to file_id +case $downloadingISVersion in + 5.9.0) + file_id="$FILE_ID_5_9" + ;; + 5.10.0) + file_id="$FILE_ID_5_10" + ;; + 5.11.0) + file_id="$FILE_ID_5_11" + ;; + 6.0.0) + file_id="$FILE_ID_6_0" + ;; + 6.1.0) + file_id="$FILE_ID_6_1" + ;; + *) + echo "No action taken.Please assign a value in env.sh if you haven't assigned a value for file ID." + ;; +esac + +# Use the file_id variable in downloading the IS zip +echo "file_id: $file_id" + +# Specify the Google Drive file URL +file_url="https://www.googleapis.com/drive/v3/files/"$file_id"?alt=media" + +set -euo pipefail + +base64var() { + printf "$1" | base64stream +} + +base64stream() { + base64 | tr '/+' '_-' | tr -d '=\n' +} + +keyJsonFile=$(echo "$MIGRATION_JSON_ENCODED" | base64 -d) +scope="https://www.googleapis.com/auth/drive.readonly" +valid_for_sec="${3:-3600}" +private_key=$(jq -r .private_key <<< "$keyJsonFile") +sa_email=$(jq -r .client_email <<< "$keyJsonFile") || { echo "Error extracting client_email from the JSON file."; exit 1; } + +header='{"alg":"RS256","typ":"JWT"}' +# Calculate the expiration time as 'valid_for_sec' seconds from now +exp=$(($(date +%s) + 60)) +# The issued at time should be the current time +iat=$(date +%s) +claim=$(cat < Failure in downloading the GA Pack $downloadingISVersion. $error_description.${NC}" + +else + # If there is no error, print the success message + echo -e "${GREEN}==> Success: GA Pack $downloadingISVersion downloaded successfully.${NC}" +fi + +# Unzip GA pack archive +unzip -qq wso2is.zip + +# View list to see the downloaded pack. +ls -a diff --git a/.github/migration-tester/migration-automation/mac-os/migration-script-mac.sh b/.github/migration-tester/migration-automation/mac-os/migration-script-mac.sh index 3d178239cbb..bc2ed7f0fe4 100644 --- a/.github/migration-tester/migration-automation/mac-os/migration-script-mac.sh +++ b/.github/migration-tester/migration-automation/mac-os/migration-script-mac.sh @@ -30,9 +30,7 @@ os=$6 email=$7 password=$8 migrationClient=$9 -gcpClientId=${10} -gcpClientSecret=${11} -gcpRefreshToken=${12} +keyJsonFile=${10} # Remove spaces from the beginning and end of the currentVersion variable currentVersion=$(echo $currentVersion | xargs) @@ -87,137 +85,20 @@ cd "$AUTOMATION_HOME_MAC" mkdir IS_HOME_OLD echo "${GREEN}==> Created a directory to place wso2IS${RESET}" -# Navigate to folder -cd "./IS_HOME_OLD" -#cd $IS_HOME_OLD_MAC -echo "${GREEN}==> Navigated to home folder successfully${RESET}" +cd "$AUTOMATION_HOME_MAC" # Download needed wso2IS zip -# Generate access token -response=$(curl --location --request POST 'https://oauth2.googleapis.com/token' \ ---header 'Content-Type: application/x-www-form-urlencoded' \ ---data-urlencode "client_id=$gcpClientId" \ ---data-urlencode "client_secret=$gcpClientSecret" \ ---data-urlencode "refresh_token=$gcpRefreshToken" \ ---data-urlencode 'grant_type=refresh_token') - -# Extract the access token from the response using jq -access_token=$(echo "$response" | jq -r '.access_token') - -# Initialize file_id variable -file_id="" - -# Check the value of currentVersion and assign the corresponding environment variable to file_id -case $currentVersion in - 5.9.0) - file_id="$FILE_ID_5_9" - ;; - 5.10.0) - file_id="$FILE_ID_5_10" - ;; - 5.11.0) - file_id="$FILE_ID_5_11" - ;; - 6.0.0) - file_id="$FILE_ID_6_0" - ;; - 6.1.0) - file_id="$FILE_ID_6_1" - ;; - *) - echo "No action taken.Please assign a value in env.sh if you haven't assigned a value for file ID." - ;; -esac - -# Use the file_id variable in downloading the IS zip -echo "file_id: $file_id" - -# Specify the Google Drive file URL -file_url="https://www.googleapis.com/drive/v3/files/"$file_id"?alt=media" - -# Download the file using the access token -response=$(curl "$file_url" \ - --header "Authorization: Bearer $access_token" \ - --header "Accept: application/json" \ - --compressed -o wso2is.zip) -wait $! - -# Check if the response contains any error message -if echo "$response" | grep -q '"error":'; then - # If there is an error, print the failure message with the error description - error_description=$(echo "$response" | jq -r '.error_description') - echo -e "${RED}${BOLD}Failure in downloading Identity Server $error_description${NC}" -else - # If there is no error, print the success message - echo -e "${PURPLE}${BOLD}Success: IS Pack downloaded successfully.${NC}" -fi - -# Unzip IS archive -unzip -qq *.zip & -wait $! -echo "${GREEN}==> Unzipped "$currentVersion" zip${RESET}" - -ls -a - -# Copy update tool from utils to bin folder -cd "/Users/runner/work/product-is/product-is/.github/migration-tester/utils/update-tools" - -cp -r $UPDATE_TOOL_MACOS $BIN_ISOLD_MAC -copy_exit_code=$? -if [ $copy_exit_code -eq 0 ]; then - echo "${GREEN}==> Update tool successfully copied to $currentVersion${RESET}" -else - echo "${RED}==> Failed to copy the update tool.${RESET}" -fi - -cd "$BIN_ISOLD_MAC" +chmod +x download-GA-pack.sh +bash download-GA-pack.sh "$keyJsonFile" "$os" "$currentVersion" "current" -# Install expect if not already installed -if ! command -v expect &> /dev/null; then - echo "Installing expect..." - brew install expect -fi - -# Create an expect script file -cat >wso2update_script.expect < Updated the Client Tool successfully${RESET}" +cd "$AUTOMATION_HOME_MAC" -# Update Product Pack -./wso2update_darwin -echo "${GREEN}==> Updated the Product Pack successfully${RESET}" +# Update downloaded GA pack +chmod +x update-GA-pack-mac.sh +sh update-GA-pack-mac.sh "$email" "$password" "current" wait $! -cd $AUTOMATION_HOME_MAC +cd "$AUTOMATION_HOME_MAC" # Given read write access to deployment.toml chmod +x "$DEPLOYMENT_MAC" @@ -291,133 +172,21 @@ echo "${GREEN}==> Directed to home successfully${RESET}" mkdir IS_HOME_NEW echo "${GREEN}==> Created a directory for placing latest wso2IS${RESET}" -# Navigate to folder -cd "$IS_HOME_NEW_MAC" +cd "$AUTOMATION_HOME_MAC" # Download needed wso2IS zip -# Generate access token -response=$(curl --location --request POST 'https://oauth2.googleapis.com/token' \ ---header 'Content-Type: application/x-www-form-urlencoded' \ ---data-urlencode "client_id=$gcpClientId" \ ---data-urlencode "client_secret=$gcpClientSecret" \ ---data-urlencode "refresh_token=$gcpRefreshToken" \ ---data-urlencode 'grant_type=refresh_token') - -# Extract the access token from the response using jq -access_token=$(echo "$response" | jq -r '.access_token') - -# Initialize file_id variable -file_id="" - -# Check the value of currentVersion and assign the corresponding environment variable to file_id -case $currentVersion in - 5.9.0) - file_id="$FILE_ID_5_9" - ;; - 5.10.0) - file_id="$FILE_ID_5_10" - ;; - 5.11.0) - file_id="$FILE_ID_5_11" - ;; - 6.0.0) - file_id="$FILE_ID_6_0" - ;; - 6.1.0) - file_id="$FILE_ID_6_1" - ;; - *) - echo "No action taken.Please assign a value in env.sh if you haven't assigned a value for file ID." - ;; -esac - -# Use the file_id variable in downloading the IS zip -echo "file_id: $file_id" - -# Specify the Google Drive file URL -file_url="https://www.googleapis.com/drive/v3/files/"$file_id"?alt=media" - -# Download the file using the access token -response=$(curl "$file_url" \ - --header "Authorization: Bearer $access_token" \ - --header "Accept: application/json" \ - --compressed -o wso2is.zip) -wait $! - -# Check if the response contains any error message -if echo "$response" | grep -q '"error":'; then - # If there is an error, print the failure message with the error description - error_description=$(echo "$response" | jq -r '.error_description') - echo -e "${RED}${BOLD}Failure in downloading Identity Server $error_description${NC}" -else - # If there is no error, print the success message - echo -e "${PURPLE}${BOLD}Success: IS Pack downloaded successfully.${NC}" -fi +chmod +x download-GA-pack.sh +bash download-GA-pack.sh "$keyJsonFile" "$os" "$currentVersion" "migrating" -# Unzip IS archive -unzip -qq *.zip & -wait $! -ls -a -echo "${GREEN}==> Unzipped "$migratingVersion" zip${RESET}" - -# Copy update tool from utils to bin folder -cd "/Users/runner/work/product-is/product-is/.github/migration-tester/utils/update-tools" - -cp -r $UPDATE_TOOL_MACOS $BIN_ISNEW_MAC -copy_exit_code=$? -if [ $copy_exit_code -eq 0 ]; then - echo "${GREEN}==> Update tool successfully copied to $currentVersion${RESET}" -else - echo "${RED}==> Failed to copy the update tool.${RESET}" -fi - -cd "$BIN_ISNEW_MAC" - -# Install expect if not already installed -if ! command -v expect &> /dev/null; then - echo "Installing expect..." - brew install expect -fi - -# Create an expect script file -cat >wso2update_script.expect < Updated the Client Tool successfully${RESET}" - -# Update Product Pack -./wso2update_darwin -echo "${GREEN}==> Updated the Product Pack successfully${RESET}" cd "$AUTOMATION_HOME_MAC" + chmod +x download-migration-client.sh sh download-migration-client.sh "$migrationClient" unzip -qq wso2is-migration-1.0.225.zip & diff --git a/.github/migration-tester/migration-automation/ubuntu-os/migration-script-ubuntu.sh b/.github/migration-tester/migration-automation/ubuntu-os/migration-script-ubuntu.sh index bc745433b46..5955edb2f57 100644 --- a/.github/migration-tester/migration-automation/ubuntu-os/migration-script-ubuntu.sh +++ b/.github/migration-tester/migration-automation/ubuntu-os/migration-script-ubuntu.sh @@ -28,9 +28,7 @@ os=$6 email=$7 password=$8 migrationClient=$9 -gcpClientId=${10} -gcpClientSecret=${11} -gcpRefreshToken=${12} +keyJsonFile=${10} # Remove spaces from the beginning and end of the currentVersion variable currentVersion=$(echo $currentVersion | xargs) @@ -84,83 +82,17 @@ cd "$AUTOMATION_HOME" mkdir IS_HOME_OLD echo "${GREEN}==> Created a directory to place wso2IS${RESET}" -# Navigate to folder -cd IS_HOME_OLD -echo "${GREEN}==> Navigated to home folder successfully${RESET}" +cd "$AUTOMATION_HOME" # Download needed wso2IS zip -# Generate access token -response=$(curl --location --request POST 'https://oauth2.googleapis.com/token' \ ---header 'Content-Type: application/x-www-form-urlencoded' \ ---data-urlencode "client_id=$gcpClientId" \ ---data-urlencode "client_secret=$gcpClientSecret" \ ---data-urlencode "refresh_token=$gcpRefreshToken" \ ---data-urlencode 'grant_type=refresh_token') - -# Extract the access token from the response using jq -access_token=$(echo "$response" | jq -r '.access_token') - -# Initialize file_id variable -file_id="" - -# Check the value of currentVersion and assign the corresponding environment variable to file_id -case $currentVersion in - 5.9.0) - file_id="$FILE_ID_5_9" - ;; - 5.10.0) - file_id="$FILE_ID_5_10" - ;; - 5.11.0) - file_id="$FILE_ID_5_11" - ;; - 6.0.0) - file_id="$FILE_ID_6_0" - ;; - 6.1.0) - file_id="$FILE_ID_6_1" - ;; - *) - echo "No action taken.Please assign a value in env.sh if you haven't assigned a value for file ID." - ;; -esac - -# Use the file_id variable in downloading the IS zip -echo "file_id: $file_id" - -# Specify the Google Drive file URL -file_url="https://www.googleapis.com/drive/v3/files/"$file_id"?alt=media" - -# Download the file using the access token -response=$(curl "$file_url" \ - --header "Authorization: Bearer $access_token" \ - --header "Accept: application/json" \ - --compressed -o wso2is.zip) -wait $! - -# Check if the response contains any error message -if echo "$response" | grep -q '"error":'; then - # If there is an error, print the failure message with the error description - error_description=$(echo "$response" | jq -r '.error_description') - echo -e "${RED}${BOLD}Failure in downloading Identity Server $error_description${NC}" -else - # If there is no error, print the success message - echo -e "${PURPLE}${BOLD}Success: IS Pack downloaded successfully.${NC}" -fi - -# Unzip IS archive -unzip -qq *.zip & -wait $! -echo "${GREEN}==> Unzipped "$currentVersion" zip${RESET}" - -ls -a +chmod +x download-GA-pack.sh +bash download-GA-pack.sh "$keyJsonFile" "$os" "$currentVersion" "current" -#cd "$AUTOMATION_HOME" -cd "$UBUNTU_HOME" +cd "$AUTOMATION_HOME" -# Update IS packs -chmod +x update-pack.sh -sh update-pack.sh "$email" "$password" "current" +# Update downloaded GA pack +chmod +x update-GA-pack-ubuntu.sh +sh update-GA-pack-ubuntu.sh "$email" "$password" "current" wait $! cd "$AUTOMATION_HOME" @@ -232,77 +164,21 @@ echo "${GREEN}==> Directed to home successfully${RESET}" mkdir IS_HOME_NEW echo "${GREEN}==> Created a directory for placing latest wso2IS${RESET}" -# Navigate to folder -cd "$IS_HOME_NEW" +cd "$AUTOMATION_HOME" # Download needed (latest) wso2IS zip -# Generate access token -response=$(curl --location --request POST 'https://oauth2.googleapis.com/token' \ ---header 'Content-Type: application/x-www-form-urlencoded' \ ---data-urlencode "client_id=$gcpClientId" \ ---data-urlencode "client_secret=$gcpClientSecret" \ ---data-urlencode "refresh_token=$gcpRefreshToken" \ ---data-urlencode 'grant_type=refresh_token') - -# Extract the access token from the response using jq -access_token=$(echo "$response" | jq -r '.access_token') - -# Initialize file_id variable -file_id="" - -# Check the value of currentVersion and assign the corresponding environment variable to file_id -case $migratingVersion in - 5.9.0) - file_id="$FILE_ID_5_9" - ;; - 5.10.0) - file_id="$FILE_ID_5_10" - ;; - 5.11.0) - file_id="$FILE_ID_5_11" - ;; - 6.0.0) - file_id="$FILE_ID_6_0" - ;; - 6.1.0) - file_id="$FILE_ID_6_1" - ;; - *) - echo "No action taken.Please assign a value in env.sh if you haven't assigned a value for file ID." - ;; -esac - -# Use the file_id variable in downloading the IS zip -echo "file_id: $file_id" - -# Specify the Google Drive file URL -file_url="https://www.googleapis.com/drive/v3/files/"$file_id"?alt=media" - -# Download the file using the access token -response=$(curl "$file_url" \ - --header "Authorization: Bearer $access_token" \ - --header "Accept: application/json" \ - --compressed -o wso2is.zip) -wait $! - -# Check if the response contains any error message -if echo "$response" | grep -q '"error":'; then - # If there is an error, print the failure message with the error description - error_description=$(echo "$response" | jq -r '.error_description') - echo -e "${RED}${BOLD}Failure in downloading Identity Server $error_description${NC}" -else - # If there is no error, print the success message - echo -e "${PURPLE}${BOLD}Success: IS Pack downloaded successfully.${NC}" -fi +chmod +x download-GA-pack.sh +bash download-GA-pack.sh "$keyJsonFile" "$os" "$migratingVersion" "migrating" -echo "${GREEN}==> Downloaded "$migratingVersion" zip${RESET}" +cd "$AUTOMATION_HOME" -# Unzip IS archive -unzip -qq *.zip & +# Update downloaded GA pack +chmod +x update-GA-pack-ubuntu.sh +sh update-GA-pack-ubuntu.sh "$email" "$password" "migrating" wait $! -echo "${GREEN}==> Unzipped "$migratingVersion" zip${RESET}" cd "$AUTOMATION_HOME" + chmod +x download-migration-client.sh sh download-migration-client.sh "$migrationClient" & wait $! diff --git a/.github/migration-tester/migration-automation/ubuntu-os/update-pack.sh b/.github/migration-tester/migration-automation/update-GA-pack-mac.sh similarity index 51% rename from .github/migration-tester/migration-automation/ubuntu-os/update-pack.sh rename to .github/migration-tester/migration-automation/update-GA-pack-mac.sh index 461287ad5aa..ad621217902 100644 --- a/.github/migration-tester/migration-automation/ubuntu-os/update-pack.sh +++ b/.github/migration-tester/migration-automation/update-GA-pack-mac.sh @@ -1,30 +1,52 @@ #!/bin/bash +# Define colours +RED='\033[0;31m' +GREEN='\033[0;32m\033[1m' +PURPLE='\033[1;35m' +BOLD='\033[1m' +RESET='\033[0m' # No Color + email=$1 password=$2 +startServer=$3 + + +# Source env file +. "/Users/runner/work/product-is/product-is/.github/migration-tester/migration-automation/env.sh" +echo -e "${GREEN}==> Env file for Macos sourced successfully${RESET}" # Copy update tool from utils to bin folder -cd "/home/runner/work/product-is/product-is/.github/migration-tester/utils/update-tools" +cd "/Users/runner/work/product-is/product-is/.github/migration-tester/utils/update-tools" -cp -r $UPDATE_TOOL_UBUNTU $BIN_ISOLD +if [ "$startServer" = "current" ]; then + cp -r $UPDATE_TOOL_MACOS $BIN_ISOLD_MAC +elif [ "$startServer" = "migrating" ]; then + cp -r $UPDATE_TOOL_MACOS $BIN_ISNEW_MAC +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 bin folder ${RESET}" else echo "${RED}==> Failed to copy the update tool.${RESET}" fi -cd "$BIN_ISOLD" - -sudo apt-get install expect -y +if [ "$startServer" = "current" ]; then + cd "$BIN_ISOLD_MAC" +elif [ "$startServer" = "migrating" ]; then + cd "$BIN_ISNEW_MAC" +fi -# Set executable permissions for the expect script -chmod +x ./wso2update_linux +# Install expect if not already installed +if ! command -v expect &> /dev/null; then + echo "Installing expect..." + brew install expect +fi # Create an expect script file cat >wso2update_script.expect < Updated the Client Tool successfully${RESET}" & +# Run the expect script in the background +./wso2update_script.expect & wait $! +echo "${GREEN}==> Updated the Client Tool successfully${RESET}" # Update Product Pack -./wso2update_linux -echo "${GREEN}==> Updated the Product Pack successfully${RESET}" & +./wso2update_darwin +echo "${GREEN}==> Updated the Product Pack successfully${RESET}" wait $! diff --git a/.github/migration-tester/migration-automation/update-pack.sh b/.github/migration-tester/migration-automation/update-GA-pack-ubuntu.sh similarity index 92% rename from .github/migration-tester/migration-automation/update-pack.sh rename to .github/migration-tester/migration-automation/update-GA-pack-ubuntu.sh index 536d3ca0eb7..32e46bb6ba2 100644 --- a/.github/migration-tester/migration-automation/update-pack.sh +++ b/.github/migration-tester/migration-automation/update-GA-pack-ubuntu.sh @@ -5,7 +5,7 @@ RED='\033[0;31m' GREEN='\033[0;32m\033[1m' PURPLE='\033[1;35m' BOLD='\033[1m' -NC='\033[0m' # No Color +RESET='\033[0m' # No Color email=$1 password=$2 @@ -14,7 +14,7 @@ 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}" +echo -e "${GREEN}==> Env file for Ubuntu sourced successfully${RESET}" # Copy update tool from utils to bin folder cd "/home/runner/work/product-is/product-is/.github/migration-tester/utils/update-tools" @@ -27,7 +27,7 @@ elif [ "$startServer" = "migrating" ]; then fi copy_exit_code=$? if [ $copy_exit_code -eq 0 ]; then - echo "${GREEN}==> Update tool successfully copied to "$startServer"${RESET}" + echo "${GREEN}==> Update tool successfully copied to bin folder${RESET}" else echo "${RED}==> Failed to copy the update tool.${RESET}" fi diff --git a/.github/migration-tester/migration-automation/update-pack-5-9.sh b/.github/migration-tester/migration-automation/update-pack-5-9.sh deleted file mode 100644 index 1d8f1aab7e5..00000000000 --- a/.github/migration-tester/migration-automation/update-pack-5-9.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -email=$1 -password=$2 - -# 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 -copy_exit_code=$? -if [ $copy_exit_code -eq 0 ]; then - echo "${GREEN}==> Update tool successfully copied to $currentVersion${RESET}" -else - echo "${RED}==> Failed to copy the update tool.${RESET}" -fi - -cd "$BIN_ISOLD" - -sudo apt-get install expect -y - -# Set executable permissions for the expect script -chmod +x ./wso2update_linux - -# Create an expect script file - cat >wso2update_script.expect < Updated the Client Tool successfully${RESET}" & - wait $! - - # Update Product Pack - ./wso2update_linux - echo "${GREEN}==> Updated the Product Pack successfully${RESET}" & - wait $! -