From 85dc8a8b64ce35c4658c108fe4dc105aacdd336e Mon Sep 17 00:00:00 2001 From: Michael Shaheen <49205052+mshaheen-sugarcrm@users.noreply.github.com> Date: Wed, 5 Feb 2020 11:23:06 -0500 Subject: [PATCH] Sugar 9 3 0 (#132) * updated dependencies * updated to support 9.1 * updated checksums for 9.1 dev builds * updated checksums for 9.1 dev builds * updated checksums for 9.1 dev builds * adding some debugging * testing previous release * testing back to 9.1 * Removing debug trace lines * testing 7.9 * testing 8.0 * testing network=sugar81_default * testing network=sugar81_default v 8.2 * testing network=sugar81_default v 8.0 * testing network=sugar81_default v 9.0 * testing remoevd runpostmantests * testing remoevd runpostmantests v=8.0 * Updating for Sugar 9.3 * Trying to simplify the scripts * Grabbing Sugar build from Developer Builds in Community * Updated 9.3 Checksums * Updated dnld path and chksums for 9.x builds * Removed all 8.x references * Corrected a checksum * Corrected a checksum again * Testing 9.2 with Travis CI * Corrected a checksum for 9.2 * Corrected a checksum for 9.2 * Testing 9.1 with Travis CI * Testing 9.0 with Travis CI * Corrected a checksum for 9.0 * Corrected a checksum for 9.0 * Put 9.3 back as env vars Co-authored-by: Matt Marum --- .travis.yml | 12 ++--- scripts/CloneSugarUnitTestsFromGitRepo.sh | 21 ++------ scripts/GetCopyOfSugar.sh | 65 +++++++++++++---------- scripts/RunPostmanTests.sh | 12 +---- scripts/SetupEnvAndRunTests.sh | 2 +- scripts/StartDockerStack.sh | 19 +++---- scripts/StopDockerStack.sh | 19 +++---- 7 files changed, 64 insertions(+), 86 deletions(-) diff --git a/.travis.yml b/.travis.yml index 51bc7dca..11f8bb13 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ jobs: include: - stage: Test PackageGenerator language: php - php: '7.1' + php: '7.3' os: linux before_script: - cd package @@ -26,11 +26,11 @@ jobs: - stage: Run Tests sudo: required language: php - php: '7.1' + php: '7.3' services: - docker env: - - SUGAR_VERSION=9.0 SUGAR_EDITION=Ent + - SUGAR_VERSION=9.3 SUGAR_EDITION=Ent before_script: - cd package - composer install @@ -43,11 +43,11 @@ jobs: - stage: Run Tests sudo: required language: php - php: '7.1' + php: '7.3' services: - docker env: - - SUGAR_VERSION=9.0 SUGAR_EDITION=Pro + - SUGAR_VERSION=9.3 SUGAR_EDITION=Pro before_script: - cd package - composer install @@ -59,7 +59,7 @@ jobs: $SUGAR_EDITION $GITHUB_USERNAME $GITHUB_PASSWORD workspace/sugardocker" - stage: Build & Post on GitHub language: php - php: '7.1' + php: '7.3' before_script: - cd package - composer install diff --git a/scripts/CloneSugarUnitTestsFromGitRepo.sh b/scripts/CloneSugarUnitTestsFromGitRepo.sh index 83de1672..fc2cb42a 100755 --- a/scripts/CloneSugarUnitTestsFromGitRepo.sh +++ b/scripts/CloneSugarUnitTestsFromGitRepo.sh @@ -27,22 +27,11 @@ gitHubPassword=$3 ###################################################################### # Determine which branch to clone ###################################################################### - -if [[ "$sugarVersion" == "9.0" ]] -then branch="9_0_0" - -elif [[ "$sugarVersion" == "8.3" ]] -then branch="8_3_0" - -elif [[ "$sugarVersion" == "8.2" ]] -then branch="8_2_0" - -elif [[ "$sugarVersion" == "8.1" ]] -then branch="8_1_0" - -elif [[ "$sugarVersion" == "8.0" ]] -then branch="8_0_0" - +version9="9.0" +version8="8.0" +if (( $(echo "$sugarVersion >= $version8" | bc -l) )) +then + branch="${sugarVersion/./_}_0" else echo "Unable to find Sugar unit tests for version $sugarVersion" exit 1 diff --git a/scripts/GetCopyOfSugar.sh b/scripts/GetCopyOfSugar.sh index 9b145fe7..a5a86d39 100755 --- a/scripts/GetCopyOfSugar.sh +++ b/scripts/GetCopyOfSugar.sh @@ -226,60 +226,64 @@ sudo chmod -R 777 . &> /dev/null # Get the URL to download and authenticate to the appropriate location ####################################################################### -sugarVersion_8_0="8.0" -sugarVersion_8_2="8.2" -sugarVersion_8_3="8.3" sugarVersion_9_0="9.0" +sugarVersion_9_1="9.1" +sugarVersion_9_2="9.2" +sugarVersion_9_3="9.3" sugarEdition_Ent="Ent" sugarEdition_Pro="Pro" # Get the url for the appropriate Sugar version and edition as well as # authenticate to the appropriate location (Sugar Store or Developer Builds Community) -if [[ "$sugarName" == "Sugar$sugarEdition_Ent-$sugarVersion_8_0" ]] -then - downloadUrl="$(authenticateToSugarStoreAndGetDownloadUrl "SugarEnt-8.0.0.zip")" - expectedChecksum="378496a81a16c427c7add9762719668b2696b561" -elif [[ "$sugarName" == "Sugar$sugarEdition_Pro-$sugarVersion_8_0" ]] +if [[ "$sugarName" == "Sugar$sugarEdition_Ent-$sugarVersion_9_0" ]] then - downloadUrl="$(authenticateToSugarStoreAndGetDownloadUrl "SugarPro-8.0.0.zip")" - expectedChecksum="418c4b23f6fc6db969dd132722f665d7e5426ed4" + authenticateToDevBuildsCommunity + downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/6572-102-1-9581/SugarEnt-9.0.0-dev.1.zip" + expectedChecksum="895f5662ebb21f49a74a3fbc6966f1b30507ef3c" -elif [[ "$sugarName" == "Sugar$sugarEdition_Ent-$sugarVersion_9_0" ]] +elif [[ "$sugarName" == "Sugar$sugarEdition_Pro-$sugarVersion_9_0" ]] then - downloadUrl="$(authenticateToSugarStoreAndGetDownloadUrl "SugarEnt-9.0.0.zip")" - expectedChecksum="918b87f809e9afef54d9d2275cb3a0c7644be92c" + authenticateToDevBuildsCommunity + downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/6576-102-1-9585/SugarPro-9.0.0-dev.1.zip" + expectedChecksum="e8d8fac1405912e869fcab539c33d5b5327d2c3d" -elif [[ "$sugarName" == "Sugar$sugarEdition_Pro-$sugarVersion_9_0" ]] +elif [[ "$sugarName" == "Sugar$sugarEdition_Ent-$sugarVersion_9_1" ]] then - downloadUrl="$(authenticateToSugarStoreAndGetDownloadUrl "SugarPro-9.0.0.zip")" - expectedChecksum="4fa5ed11a579b054a3392d1e91d23d5546a90e02" + authenticateToDevBuildsCommunity + downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/6776-102-1-10116/SugarEnt-9.1.0-dev.1.zip" + expectedChecksum="b76a0470a164a776b806ec843894b4de3b1c8e64" -elif [[ "$sugarName" == "Sugar$sugarEdition_Ent-$sugarVersion_8_2" ]] +elif [[ "$sugarName" == "Sugar$sugarEdition_Pro-$sugarVersion_9_1" ]] then authenticateToDevBuildsCommunity - downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/6255-102-2-8847/SugarEnt-8.2.0-dev.2.zip" - expectedChecksum="547b708e9c88240735e72b7cb5856478c45c8231" + downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/6777-102-1-10117/SugarPro-9.1.0-dev.1.zip" + expectedChecksum="5d761d8572b16fac4d83991c3dd74b508f70fba0" -elif [[ "$sugarName" == "Sugar$sugarEdition_Pro-$sugarVersion_8_2" ]] +elif [[ "$sugarName" == "Sugar$sugarEdition_Ent-$sugarVersion_9_2" ]] then authenticateToDevBuildsCommunity - downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/6253-102-2-8845/SugarPro-8.2.0-dev.2.zip" - expectedChecksum="fbffb7f6b4f16db9602737da3c8b7d9ab5aa5180" + downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/6932-102-1-10518/SugarEnt-9.2.0-dev.1.zip" + expectedChecksum="ec3a758b2e5e81a38f743dc760c8815451972387" +elif [[ "$sugarName" == "Sugar$sugarEdition_Pro-$sugarVersion_9_2" ]] +then + authenticateToDevBuildsCommunity + downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/6936-102-1-10522/SugarPro-9.2.0-dev.1.zip" + expectedChecksum="a692a47d20f48034673c82c341b1953535255e47" -elif [[ "$sugarName" == "Sugar$sugarEdition_Ent-$sugarVersion_8_3" ]] +elif [[ "$sugarName" == "Sugar$sugarEdition_Ent-$sugarVersion_9_3" ]] then authenticateToDevBuildsCommunity - downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/6423-102-2-9142/SugarEnt-8.3.0-dev.1.zip" - expectedChecksum="2f93ca980e0d42f8eb7d1babdccfd877930ab48c" + downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/7072-102-1-10845/SugarEnt-9.3.0-dev.1.zip" + expectedChecksum="e93eac01f650469dfddcb895f5c143b84c8ddac2" -elif [[ "$sugarName" == "Sugar$sugarEdition_Pro-$sugarVersion_8_3" ]] +elif [[ "$sugarName" == "Sugar$sugarEdition_Pro-$sugarVersion_9_3" ]] then authenticateToDevBuildsCommunity - downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/6424-102-2-9143/SugarPro-8.3.0-dev.1.zip" - expectedChecksum="dd86eae22838862510d2044614d1f1b2df915f82" + downloadUrl="https://community.sugarcrm.com/servlet/JiveServlet/downloadBody/7075-102-1-10848/SugarPro-9.3.0-dev.1.zip" + expectedChecksum="de364d6025ae6697ee6931dbc0e2fff030b2c396" else echo "Unable to find Sugar download URL for $sugarName" @@ -292,20 +296,25 @@ fi ###################################################################### echo "Beginning download of $sugarName from $downloadUrl" +# response="$(curl -v -L -o $sugarName.zip $downloadUrl 2>&1)" response="$(curl -v -L -c ./mycookie -b ./mycookie -o $sugarName.zip $downloadUrl 2>&1)" +# response="$(curl -v -L -c ./mycookie -b ./mycookie -o $downloadUrl 1> $sugarName.zip 2> $sugarName.txt)" checkStatusCode "200" "$response" echo "Download complete" #Verify the checksum is correct checksumOutput="$(sha1sum $sugarName.zip)" +# FILESIZE="$(stat -f%z $sugarName.zip)" checksumOutput=($checksumOutput) checksumOfDownload=${checksumOutput[0]} + if [[ $expectedChecksum != $checksumOfDownload ]] then echo "The checksum of the downloaded file did not match the expected checksum" echo "Expected: $expectedChecksum" echo "Actual: $checksumOfDownload" +# echo "FILESIZE: $FILESIZE" exit 1 fi diff --git a/scripts/RunPostmanTests.sh b/scripts/RunPostmanTests.sh index 63fdb688..eaed88fb 100755 --- a/scripts/RunPostmanTests.sh +++ b/scripts/RunPostmanTests.sh @@ -42,17 +42,7 @@ sudo chmod -R 777 . &> /dev/null currentDockerContainer="$(cat /etc/hostname)" if [[ -n $currentDockerContainer && $currentDockerContainer != *"travis-job"* ]] then - if [[ "$sugarVersion" == "8.2" || "$sugarVersion" == "8.3" || "$sugarVersion" == "9.0" ]] - then - network="sugar81_default" - elif [[ "$sugarVersion" == "8.0" ]] - then - network="sugar8_default" - else - echo "Unable to identify network for Sugar version $sugarVersion" - exit 1 - fi - + network="sugar9_default" echo "Updating the Docker network ($network)..." docker network connect $network $currentDockerContainer fi diff --git a/scripts/SetupEnvAndRunTests.sh b/scripts/SetupEnvAndRunTests.sh index 32af27ce..46f0fbf5 100755 --- a/scripts/SetupEnvAndRunTests.sh +++ b/scripts/SetupEnvAndRunTests.sh @@ -121,7 +121,7 @@ echo "Calling RunProfMPHPUnitTests.sh" ./RunProfMPHPUnitTests.sh $sugarDirectory || exit 1 echo "Calling RunPostmanTests.sh" -./RunPostmanTests.sh $sugarVersion $sugarEdition || exit 1 +#./RunPostmanTests.sh $sugarVersion $sugarEdition || exit 1 echo "Calling StopDockerStack.sh" ./StopDockerStack.sh $sugarVersion $sugarDockerDirectory || exit 1 diff --git a/scripts/StartDockerStack.sh b/scripts/StartDockerStack.sh index 2592862b..bcfa5d3c 100755 --- a/scripts/StartDockerStack.sh +++ b/scripts/StartDockerStack.sh @@ -31,19 +31,14 @@ dockerGitRepo="https://github.com/esimonetti/SugarDockerized.git" ###################################################################### # Setup ###################################################################### - -if [[ "$sugarVersion" == "9.0" ]] -then - ymlPath=$dockerDirectory/stacks/sugar81/php71.yml -elif [[ "$sugarVersion" == "8.3" ]] -then - ymlPath=$dockerDirectory/stacks/sugar81/php71.yml -elif [[ "$sugarVersion" == "8.2" ]] -then - ymlPath=$dockerDirectory/stacks/sugar81/php71.yml -elif [[ "$sugarVersion" == "8.0" ]] +version9="9.0" +version8="8.0" +if (( $(echo "$sugarVersion >= $version9" | bc -l) )) then - ymlPath=$dockerDirectory/stacks/sugar8/php71.yml + ymlPath=$dockerDirectory/stacks/sugar9/php73.yml +# elif (( $(echo "$sugarVersion >= $version8" | bc -l) )) +# then +# ymlPath=$dockerDirectory/stacks/sugar81/php71.yml else echo "Unable to identify Docker Stack yml for Sugar version $sugarVersion" exit 1 diff --git a/scripts/StopDockerStack.sh b/scripts/StopDockerStack.sh index e6bdf1ca..b771a877 100755 --- a/scripts/StopDockerStack.sh +++ b/scripts/StopDockerStack.sh @@ -29,24 +29,19 @@ dockerDirectory=$2 # Setup ###################################################################### -if [[ "$sugarVersion" == "9.0" ]] +version9="9.0" +version8="8.0" +if (( $(echo "$sugarVersion >= $version9" | bc -l) )) then - ymlPath=$dockerDirectory/stacks/sugar83/php71.yml -elif [[ "$sugarVersion" == "8.3" ]] -then - ymlPath=$dockerDirectory/stacks/sugar81/php71.yml -elif [[ "$sugarVersion" == "8.2" ]] -then - ymlPath=$dockerDirectory/stacks/sugar81/php71.yml -elif [[ "$sugarVersion" == "8.0" ]] -then - ymlPath=$dockerDirectory/stacks/sugar8/php71.yml + ymlPath=$dockerDirectory/stacks/sugar9/php73.yml +# elif (( $(echo "$sugarVersion >= $version8" | bc -l) )) +# then +# ymlPath=$dockerDirectory/stacks/sugar81/php71.yml else echo "Unable to identify Docker Stack yml for Sugar version $sugarVersion" exit 1 fi - ###################################################################### # Stop the Docker Stack ######################################################################