From 003286b6698b4e6fd423ef90b33bee5a761f42fb Mon Sep 17 00:00:00 2001 From: Ariana Date: Fri, 29 Dec 2023 10:56:45 -0500 Subject: [PATCH 01/16] scripts aws deploy revision --- appspec.yml | 10 +++---- build.gradle | 4 +-- {scripts => deploy_scripts}/backup | 0 deploy_scripts/config_files | 30 +++++++++++++++++++ .../install_dependencies | 10 ++++--- {scripts => deploy_scripts}/start_services | 0 {scripts => deploy_scripts}/stop_services | 0 scripts/config_files | 29 ------------------ src/test/resources/GebConfig.groovy | 2 ++ 9 files changed, 45 insertions(+), 40 deletions(-) rename {scripts => deploy_scripts}/backup (100%) create mode 100755 deploy_scripts/config_files rename {scripts => deploy_scripts}/install_dependencies (62%) rename {scripts => deploy_scripts}/start_services (100%) rename {scripts => deploy_scripts}/stop_services (100%) delete mode 100755 scripts/config_files diff --git a/appspec.yml b/appspec.yml index 79f6ba0..9ced4df 100644 --- a/appspec.yml +++ b/appspec.yml @@ -49,26 +49,26 @@ hooks: # During the BeforeInstall deployment lifecycle event, run the commands # in the script specified in "location". BeforeInstall: - #- location: scripts/backup + #- location: deploy_scripts/backup # timeout: 300 # runas: root - - location: scripts/install_dependencies + - location: deploy_scripts/install_dependencies timeout: 300 runas: root # During the AfterInstall deployment lifecycle event, run the commands # in the script specified in "location". AfterInstall: - - location: scripts/config_files + - location: deploy_scripts/config_files timeout: 300 runas: root - - location: scripts/start_services + - location: deploy_scripts/start_services timeout: 300 runas: root # During the ApplicationStop deployment lifecycle event, run the commands # in the script specified in "location" starting from the root of the # revision's file bundle. ApplicationStop: - - location: scripts/stop_services + - location: deploy_scripts/stop_services timeout: 300 runas: root diff --git a/build.gradle b/build.gradle index 47671a7..9980645 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ ext { groovyVersion = '2.4.12' gebVersion = '2.2' seleniumVersion = '3.6.0' - chromeDriverVersion = '97.0.4692.71' + // chromeDriverVersion = '114.0.5735.16' geckoDriverVersion = '0.23.0' } } @@ -48,7 +48,7 @@ dependencies { } webdriverBinaries { - chromedriver chromeDriverVersion + // chromedriver chromeDriverVersion geckodriver geckoDriverVersion } diff --git a/scripts/backup b/deploy_scripts/backup similarity index 100% rename from scripts/backup rename to deploy_scripts/backup diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files new file mode 100755 index 0000000..36a424b --- /dev/null +++ b/deploy_scripts/config_files @@ -0,0 +1,30 @@ +#!/bin/bash +#Verifying the instance +#Finding the current ip +# IP=$(hostname -I | awk '{print $1}') +# #Testing Instance +# testingInstance="172.31.20.165" +# #Staging Instance +# stagingInstance="172.31.12.113" +# #172.31.1.41 Ari Testing Instance +# testingInstanceTmp="172.31.1.41" + +# echo $IP +# if [[ "$IP" == $testingInstance || "$IP" == $testingInstanceTmp ]]; then +# echo "It's the testing instance" +# #Change portal route +# sudo sed -i 's/portal.muuktest.com/testing.muuktest.com/g' /home/ubuntu/projects/executor/mkcli.py +# elif [[ "$IP" == $stagingInstance ]]; then +# echo "It's the staging instance" +# #Change portal route +# sudo sed -i 's/portal.muuktest.com/staging.muuktest.com/g' /home/ubuntu/projects/executor/mkcli.py +# fi + +#Setting the cloud key +#The cloud key it's located in a external env.json file +if [[ -f "/home/ubuntu/default.json" ]]; then + + # cloudKey=$(cat /home/ubuntu/default.json | jq -r '.cloudKey') + # sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py + # sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py +fi \ No newline at end of file diff --git a/scripts/install_dependencies b/deploy_scripts/install_dependencies similarity index 62% rename from scripts/install_dependencies rename to deploy_scripts/install_dependencies index 7e6b874..0ad88ba 100644 --- a/scripts/install_dependencies +++ b/deploy_scripts/install_dependencies @@ -9,10 +9,12 @@ sudo apt -y install xvfb #Installing firefox sudo apt -y install firefox #Installing google chrome -wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -sudo apt -y install ./google-chrome-stable_current_amd64.deb -sudo apt-get install google-chrome-stable -sudo rm google-chrome-stable_current_amd64.deb + +# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb +# sudo apt -y install ./google-chrome-stable_current_amd64.deb +# sudo apt-get install google-chrome-stable +# sudo rm google-chrome-stable_current_amd64.deb + #Installing ffmpeg sudo apt -y install ffmpeg #Installing request diff --git a/scripts/start_services b/deploy_scripts/start_services similarity index 100% rename from scripts/start_services rename to deploy_scripts/start_services diff --git a/scripts/stop_services b/deploy_scripts/stop_services similarity index 100% rename from scripts/stop_services rename to deploy_scripts/stop_services diff --git a/scripts/config_files b/scripts/config_files deleted file mode 100755 index eb24a4b..0000000 --- a/scripts/config_files +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -#Verifying the instance -#Finding the current ip -IP=$(hostname -I | awk '{print $1}') -#Testing Instance -testingInstance="172.31.20.165" -#Staging Instance -stagingInstance="172.31.12.113" -#172.31.1.41 Ari Testing Instance -testingInstanceTmp="172.31.1.41" - -echo $IP -if [[ "$IP" == $testingInstance || "$IP" == $testingInstanceTmp ]]; then - echo "It's the testing instance" - #Change portal route - sudo sed -i 's/portal.muuktest.com/testing.muuktest.com/g' /home/ubuntu/projects/executor/mkcli.py -elif [[ "$IP" == $stagingInstance ]]; then - echo "It's the staging instance" - #Change portal route - sudo sed -i 's/portal.muuktest.com/staging.muuktest.com/g' /home/ubuntu/projects/executor/mkcli.py -fi - -#Setting the cloud key -#The cloud key it's located in a external env.json file -if [[ -f "/home/ubuntu/env.json" ]]; then - cloudKey=$(cat /home/ubuntu/env.json | jq -r '.cloudKey') - sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py - sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py -fi \ No newline at end of file diff --git a/src/test/resources/GebConfig.groovy b/src/test/resources/GebConfig.groovy index 5fe535f..eedd416 100644 --- a/src/test/resources/GebConfig.groovy +++ b/src/test/resources/GebConfig.groovy @@ -17,10 +17,12 @@ environments { // See: http://code.google.com/p/selenium/wiki/ChromeDriver chrome { driver = { + System.setProperty("webdriver.chrome.driver", "/home/ubuntu/projects/chrome-linux64/chromedriver") ChromeOptions o = new ChromeOptions() o.addArguments('--no-sandbox'); o.addArguments('--disable-dev-shm-usage'); o.addArguments("--ignore-certificate-errors"); + o.setBinary("/home/ubuntu/projects/chrome-linux64/chrome") DesiredCapabilities cap=DesiredCapabilities.chrome(); cap.setCapability(ChromeOptions.CAPABILITY, o); cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); From d7afa9d65e22b0facbd67aac3e82c76ee425be54 Mon Sep 17 00:00:00 2001 From: Ariana Date: Fri, 29 Dec 2023 13:19:13 -0500 Subject: [PATCH 02/16] disabled after install --- appspec.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/appspec.yml b/appspec.yml index 9ced4df..b5abad5 100644 --- a/appspec.yml +++ b/appspec.yml @@ -57,18 +57,18 @@ hooks: runas: root # During the AfterInstall deployment lifecycle event, run the commands # in the script specified in "location". - AfterInstall: - - location: deploy_scripts/config_files - timeout: 300 - runas: root - - location: deploy_scripts/start_services - timeout: 300 - runas: root + # AfterInstall: + # - location: deploy_scripts/config_files + # timeout: 300 + # runas: root + # - location: deploy_scripts/start_services + # timeout: 300 + # runas: root # During the ApplicationStop deployment lifecycle event, run the commands # in the script specified in "location" starting from the root of the # revision's file bundle. - ApplicationStop: - - location: deploy_scripts/stop_services - timeout: 300 - runas: root + # ApplicationStop: + # - location: deploy_scripts/stop_services + # timeout: 300 + # runas: root From 8ed10352ceaf47d420b00c7acd2b6f6f3609ca1a Mon Sep 17 00:00:00 2001 From: Ariana Date: Tue, 2 Jan 2024 11:44:47 -0500 Subject: [PATCH 03/16] Enabled update cloud key --- appspec.yml | 6 +++--- deploy_scripts/config_files | 31 ++++++----------------------- deploy_scripts/install_dependencies | 7 ------- 3 files changed, 9 insertions(+), 35 deletions(-) diff --git a/appspec.yml b/appspec.yml index b5abad5..b665547 100644 --- a/appspec.yml +++ b/appspec.yml @@ -58,9 +58,9 @@ hooks: # During the AfterInstall deployment lifecycle event, run the commands # in the script specified in "location". # AfterInstall: - # - location: deploy_scripts/config_files - # timeout: 300 - # runas: root + - location: deploy_scripts/config_files + timeout: 300 + runas: root # - location: deploy_scripts/start_services # timeout: 300 # runas: root diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index 36a424b..44907a4 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -1,30 +1,11 @@ #!/bin/bash -#Verifying the instance -#Finding the current ip -# IP=$(hostname -I | awk '{print $1}') -# #Testing Instance -# testingInstance="172.31.20.165" -# #Staging Instance -# stagingInstance="172.31.12.113" -# #172.31.1.41 Ari Testing Instance -# testingInstanceTmp="172.31.1.41" - -# echo $IP -# if [[ "$IP" == $testingInstance || "$IP" == $testingInstanceTmp ]]; then -# echo "It's the testing instance" -# #Change portal route -# sudo sed -i 's/portal.muuktest.com/testing.muuktest.com/g' /home/ubuntu/projects/executor/mkcli.py -# elif [[ "$IP" == $stagingInstance ]]; then -# echo "It's the staging instance" -# #Change portal route -# sudo sed -i 's/portal.muuktest.com/staging.muuktest.com/g' /home/ubuntu/projects/executor/mkcli.py -# fi +#Changing the executor permissions +sudo chmod 777 /home/ubuntu/projects/executor #Setting the cloud key #The cloud key it's located in a external env.json file -if [[ -f "/home/ubuntu/default.json" ]]; then - - # cloudKey=$(cat /home/ubuntu/default.json | jq -r '.cloudKey') - # sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py - # sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py +if [[ -f "/home/ubuntu/config.json" ]]; then + cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') + sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py + sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py fi \ No newline at end of file diff --git a/deploy_scripts/install_dependencies b/deploy_scripts/install_dependencies index 0ad88ba..ca68d98 100644 --- a/deploy_scripts/install_dependencies +++ b/deploy_scripts/install_dependencies @@ -8,13 +8,6 @@ sudo pip3 install BeautifulSoup4 sudo apt -y install xvfb #Installing firefox sudo apt -y install firefox -#Installing google chrome - -# wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -# sudo apt -y install ./google-chrome-stable_current_amd64.deb -# sudo apt-get install google-chrome-stable -# sudo rm google-chrome-stable_current_amd64.deb - #Installing ffmpeg sudo apt -y install ffmpeg #Installing request From 7af83c9feced78c6f9d62b4c93886089ae507323 Mon Sep 17 00:00:00 2001 From: Ariana Date: Tue, 2 Jan 2024 12:59:06 -0500 Subject: [PATCH 04/16] changing the muuktestRoute --- deploy_scripts/config_files | 7 ++++++- deploy_scripts/install_dependencies | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index 44907a4..3a62faf 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -3,8 +3,13 @@ sudo chmod 777 /home/ubuntu/projects/executor #Setting the cloud key -#The cloud key it's located in a external env.json file +#The cloud key it's located in a external config.json file if [[ -f "/home/ubuntu/config.json" ]]; then + #Changing portal route to the proper one in the config file + muuktestRoute=$(cat /home/ubuntu/config.json | jq -r '.muuktestRoute') + sudo sed -i "s/portal.muuktest.com/'$muuktestRoute'" /home/ubuntu/projects/executor/mkcli.py + + #Adding the cloudKey in the mkcloud.py file cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py diff --git a/deploy_scripts/install_dependencies b/deploy_scripts/install_dependencies index ca68d98..f1dee92 100644 --- a/deploy_scripts/install_dependencies +++ b/deploy_scripts/install_dependencies @@ -13,4 +13,6 @@ sudo apt -y install ffmpeg #Installing request pip3 install request #Installing jq to read json files -sudo apt -y install jq \ No newline at end of file +sudo apt -y install jq +#Installing lxml +sudo pip3 install lxml \ No newline at end of file From f9993524ee82df5fbc563863c30c20bdffe8266a Mon Sep 17 00:00:00 2001 From: Ariana Date: Tue, 2 Jan 2024 15:08:11 -0500 Subject: [PATCH 05/16] Using chrome 114 --- build.gradle | 4 ++-- deploy_scripts/config_files | 23 +++++++++++++++-------- src/test/resources/GebConfig.groovy | 2 -- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 9980645..5729fbf 100644 --- a/build.gradle +++ b/build.gradle @@ -13,8 +13,8 @@ ext { groovyVersion = '2.4.12' gebVersion = '2.2' seleniumVersion = '3.6.0' - // chromeDriverVersion = '114.0.5735.16' - geckoDriverVersion = '0.23.0' + chromeDriverVersion = '114.0.5735.198' + geckoDriverVersion = '0.28.0' } } diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index 3a62faf..2d38863 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -1,16 +1,23 @@ #!/bin/bash #Changing the executor permissions -sudo chmod 777 /home/ubuntu/projects/executor +sudo chmod -R 777 /home/ubuntu/projects/executor/ +sudo chmod 777 /home/ubuntu/projects/executor/gradlew #Setting the cloud key #The cloud key it's located in a external config.json file -if [[ -f "/home/ubuntu/config.json" ]]; then +if [[ -f "/home/ubuntu/default.json" ]]; then + echo "Default File exists" + #Changing portal route to the proper one in the config file - muuktestRoute=$(cat /home/ubuntu/config.json | jq -r '.muuktestRoute') - sudo sed -i "s/portal.muuktest.com/'$muuktestRoute'" /home/ubuntu/projects/executor/mkcli.py + muuktestRoute=$(cat /home/ubuntu/default.json | jq -r '.Muuklabs.prototype.BE_route') + echo $muuktestRoute + sudo sed -i "s_https://portal.muuktest.com:8081/_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py +fi +# if [[ -f "/home/ubuntu/config.json" ]]; then +# echo "Config File exists" #Adding the cloudKey in the mkcloud.py file - cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') - sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py - sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py -fi \ No newline at end of file + # cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') + # sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py + # sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py +# fi \ No newline at end of file diff --git a/src/test/resources/GebConfig.groovy b/src/test/resources/GebConfig.groovy index eedd416..5fe535f 100644 --- a/src/test/resources/GebConfig.groovy +++ b/src/test/resources/GebConfig.groovy @@ -17,12 +17,10 @@ environments { // See: http://code.google.com/p/selenium/wiki/ChromeDriver chrome { driver = { - System.setProperty("webdriver.chrome.driver", "/home/ubuntu/projects/chrome-linux64/chromedriver") ChromeOptions o = new ChromeOptions() o.addArguments('--no-sandbox'); o.addArguments('--disable-dev-shm-usage'); o.addArguments("--ignore-certificate-errors"); - o.setBinary("/home/ubuntu/projects/chrome-linux64/chrome") DesiredCapabilities cap=DesiredCapabilities.chrome(); cap.setCapability(ChromeOptions.CAPABILITY, o); cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); From 8f47461318ad4f0b3347c60ef653f029e50c94bc Mon Sep 17 00:00:00 2001 From: Ariana Date: Tue, 2 Jan 2024 15:52:22 -0500 Subject: [PATCH 06/16] Uncommenting After install --- appspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appspec.yml b/appspec.yml index b665547..e0414af 100644 --- a/appspec.yml +++ b/appspec.yml @@ -57,7 +57,7 @@ hooks: runas: root # During the AfterInstall deployment lifecycle event, run the commands # in the script specified in "location". - # AfterInstall: + AfterInstall: - location: deploy_scripts/config_files timeout: 300 runas: root From 30890f9cf9b5e007120b470205cc2fa0e512be41 Mon Sep 17 00:00:00 2001 From: Ariana Date: Tue, 2 Jan 2024 15:57:17 -0500 Subject: [PATCH 07/16] Enabled cloudKey adding --- deploy_scripts/config_files | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index 2d38863..90c20a4 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -14,10 +14,10 @@ if [[ -f "/home/ubuntu/default.json" ]]; then sudo sed -i "s_https://portal.muuktest.com:8081/_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py fi -# if [[ -f "/home/ubuntu/config.json" ]]; then -# echo "Config File exists" - #Adding the cloudKey in the mkcloud.py file - # cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') - # sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py - # sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py -# fi \ No newline at end of file +if [[ -f "/home/ubuntu/config.json" ]]; then + echo "Config File exists" + # Adding the cloudKey in the mkcloud.py file + cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') + sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py + sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py +fi \ No newline at end of file From afb70d2e1cb98396a4631c72b61ead69a1505cfa Mon Sep 17 00:00:00 2001 From: Ariana Date: Wed, 3 Jan 2024 13:50:41 -0500 Subject: [PATCH 08/16] Be route in config.json --- appspec.yml | 6 +++--- build.gradle | 6 +++--- deploy_scripts/config_files | 11 ++++------- deploy_scripts/start_services | 4 ++-- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/appspec.yml b/appspec.yml index e0414af..eae65d6 100644 --- a/appspec.yml +++ b/appspec.yml @@ -61,9 +61,9 @@ hooks: - location: deploy_scripts/config_files timeout: 300 runas: root - # - location: deploy_scripts/start_services - # timeout: 300 - # runas: root + - location: deploy_scripts/start_services + timeout: 300 + runas: root # During the ApplicationStop deployment lifecycle event, run the commands # in the script specified in "location" starting from the root of the # revision's file bundle. diff --git a/build.gradle b/build.gradle index 5729fbf..30da69b 100644 --- a/build.gradle +++ b/build.gradle @@ -13,8 +13,8 @@ ext { groovyVersion = '2.4.12' gebVersion = '2.2' seleniumVersion = '3.6.0' - chromeDriverVersion = '114.0.5735.198' - geckoDriverVersion = '0.28.0' + chromeDriverVersion = '114.0.5735.90' + geckoDriverVersion = '0.23.0' } } @@ -48,7 +48,7 @@ dependencies { } webdriverBinaries { - // chromedriver chromeDriverVersion + chromedriver chromeDriverVersion geckodriver geckoDriverVersion } diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index 90c20a4..30c0808 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -5,17 +5,14 @@ sudo chmod 777 /home/ubuntu/projects/executor/gradlew #Setting the cloud key #The cloud key it's located in a external config.json file -if [[ -f "/home/ubuntu/default.json" ]]; then - echo "Default File exists" +if [[ -f "/home/ubuntu/config.json" ]]; then + echo "Config File exists" #Changing portal route to the proper one in the config file - muuktestRoute=$(cat /home/ubuntu/default.json | jq -r '.Muuklabs.prototype.BE_route') + muuktestRoute=$(cat /home/ubuntu/config.json | jq -r '.BERoute') echo $muuktestRoute - sudo sed -i "s_https://portal.muuktest.com:8081/_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py -fi + sudo sed -i "s_https://portal.muuktest.com:8081_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py -if [[ -f "/home/ubuntu/config.json" ]]; then - echo "Config File exists" # Adding the cloudKey in the mkcloud.py file cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py diff --git a/deploy_scripts/start_services b/deploy_scripts/start_services index e2d58ea..9b764c6 100644 --- a/deploy_scripts/start_services +++ b/deploy_scripts/start_services @@ -1,8 +1,8 @@ #!/bin/bash -sudo chmod 777 /home/ubuntu/projects/executor/gradlew +# sudo chmod 777 /home/ubuntu/projects/executor/gradlew Xvfb :99 -screen 0 1366x768x16 & -#Starting queue service in case it is needed +# Starting queue service in case it is needed serviceStatus=`systemctl is-active muuktest-queued.service` queueServiceFile=/lib/systemd/system/muuktest-queued.service if [[ "$serviceStatus" != 'active' ]] && [ -f "$queueServiceFile" ]; then From b749089839e274b84215f471fdafe63b4211b940 Mon Sep 17 00:00:00 2001 From: Ariana Date: Wed, 3 Jan 2024 14:28:35 -0500 Subject: [PATCH 09/16] Installing google 114 --- deploy_scripts/install_dependencies | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy_scripts/install_dependencies b/deploy_scripts/install_dependencies index f1dee92..419eeb5 100644 --- a/deploy_scripts/install_dependencies +++ b/deploy_scripts/install_dependencies @@ -15,4 +15,8 @@ pip3 install request #Installing jq to read json files sudo apt -y install jq #Installing lxml -sudo pip3 install lxml \ No newline at end of file +sudo pip3 install lxml +#Installing Google 114 +wget https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_114.0.5735.198-1_amd64.deb +sudo dpkg -i google-chrome-stable_114.0.5735.198-1_amd64.deb +sudo rm google-chrome-stable_114.0.5735.198-1_amd64.deb \ No newline at end of file From 8f2d592d0ce2fbf9f41cd7229a00f303614881f5 Mon Sep 17 00:00:00 2001 From: Ariana Date: Wed, 3 Jan 2024 16:32:29 -0500 Subject: [PATCH 10/16] chown ubuntu --- deploy_scripts/config_files | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index 30c0808..09bea0f 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -1,7 +1,6 @@ #!/bin/bash #Changing the executor permissions -sudo chmod -R 777 /home/ubuntu/projects/executor/ -sudo chmod 777 /home/ubuntu/projects/executor/gradlew +sudo chown -R ubuntu:ubuntu /home/ubuntu/projects/executor #Setting the cloud key #The cloud key it's located in a external config.json file From f95aaf6df5b565c63da7a96a89268b952a1b3575 Mon Sep 17 00:00:00 2001 From: Ariana Date: Wed, 3 Jan 2024 17:04:57 -0500 Subject: [PATCH 11/16] Added validation to update the BE route and cloud Key only if exists --- deploy_scripts/config_files | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index 09bea0f..1df06e6 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -10,10 +10,15 @@ if [[ -f "/home/ubuntu/config.json" ]]; then #Changing portal route to the proper one in the config file muuktestRoute=$(cat /home/ubuntu/config.json | jq -r '.BERoute') echo $muuktestRoute - sudo sed -i "s_https://portal.muuktest.com:8081_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py + if [[ $muuktestRoute ]]; then + #Change the BE route in the mkcli.py file + sudo sed -i "s_https://portal.muuktest.com:8081_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py + fi # Adding the cloudKey in the mkcloud.py file cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') - sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py - sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py + if [[ $cloudKey ]]; then + sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py + sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py + fi fi \ No newline at end of file From 37e7faed78522c232f0cbc290b9b7cbc7e15c511 Mon Sep 17 00:00:00 2001 From: Ariana Date: Wed, 3 Jan 2024 17:11:46 -0500 Subject: [PATCH 12/16] Added validation to update the BE route and cloud Key only if exists --- deploy_scripts/config_files | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index 1df06e6..f11a245 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -10,14 +10,14 @@ if [[ -f "/home/ubuntu/config.json" ]]; then #Changing portal route to the proper one in the config file muuktestRoute=$(cat /home/ubuntu/config.json | jq -r '.BERoute') echo $muuktestRoute - if [[ $muuktestRoute ]]; then + if [[ ! -z "$muuktestRoute" ]]; then #Change the BE route in the mkcli.py file sudo sed -i "s_https://portal.muuktest.com:8081_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py fi # Adding the cloudKey in the mkcloud.py file cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') - if [[ $cloudKey ]]; then + if [[ ! -z "$cloudKey" ]]; then sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py fi From 8127f446e459535ca72a43f610f0eb41eb3ee331 Mon Sep 17 00:00:00 2001 From: Ariana Date: Wed, 3 Jan 2024 17:13:55 -0500 Subject: [PATCH 13/16] Added validation to update the BE route and cloud Key only if exists --- deploy_scripts/config_files | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index f11a245..7ed9752 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -10,14 +10,14 @@ if [[ -f "/home/ubuntu/config.json" ]]; then #Changing portal route to the proper one in the config file muuktestRoute=$(cat /home/ubuntu/config.json | jq -r '.BERoute') echo $muuktestRoute - if [[ ! -z "$muuktestRoute" ]]; then + if [[ ! -z $muuktestRoute ]]; then #Change the BE route in the mkcli.py file sudo sed -i "s_https://portal.muuktest.com:8081_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py fi # Adding the cloudKey in the mkcloud.py file cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') - if [[ ! -z "$cloudKey" ]]; then + if [[ ! -z $cloudKey ]]; then sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py fi From 2f9e23e95aa4904dd852e6dc04ddd15b58318e31 Mon Sep 17 00:00:00 2001 From: Ariana Date: Wed, 3 Jan 2024 17:22:17 -0500 Subject: [PATCH 14/16] Added validation to update the BE route and cloud Key only if exists --- deploy_scripts/config_files | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index 7ed9752..daeca53 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -10,14 +10,14 @@ if [[ -f "/home/ubuntu/config.json" ]]; then #Changing portal route to the proper one in the config file muuktestRoute=$(cat /home/ubuntu/config.json | jq -r '.BERoute') echo $muuktestRoute - if [[ ! -z $muuktestRoute ]]; then + if [[ -n "$muuktestRoute" ]]; then #Change the BE route in the mkcli.py file sudo sed -i "s_https://portal.muuktest.com:8081_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py fi # Adding the cloudKey in the mkcloud.py file cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') - if [[ ! -z $cloudKey ]]; then + if [[ -n "$cloudKey" ]]; then sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py fi From f24f835ed3cc681e9ce6198dbaef316526d6190e Mon Sep 17 00:00:00 2001 From: Ariana Date: Wed, 3 Jan 2024 17:38:25 -0500 Subject: [PATCH 15/16] Added validation to update the BE route and cloud Key only if exists --- deploy_scripts/config_files | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index daeca53..10347c1 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -10,14 +10,14 @@ if [[ -f "/home/ubuntu/config.json" ]]; then #Changing portal route to the proper one in the config file muuktestRoute=$(cat /home/ubuntu/config.json | jq -r '.BERoute') echo $muuktestRoute - if [[ -n "$muuktestRoute" ]]; then + if [[ "$muuktestRoute" != null ]]; then #Change the BE route in the mkcli.py file sudo sed -i "s_https://portal.muuktest.com:8081_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py fi # Adding the cloudKey in the mkcloud.py file cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') - if [[ -n "$cloudKey" ]]; then + if [[ "$cloudKey" != null ]]; then sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py fi From 50306236e44f64ba025e170bc186c3f9db791f0a Mon Sep 17 00:00:00 2001 From: Ariana Date: Wed, 3 Jan 2024 17:41:17 -0500 Subject: [PATCH 16/16] Added validation to update the BE route and cloud Key only if exists --- deploy_scripts/config_files | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy_scripts/config_files b/deploy_scripts/config_files index 10347c1..f8a778f 100755 --- a/deploy_scripts/config_files +++ b/deploy_scripts/config_files @@ -10,14 +10,14 @@ if [[ -f "/home/ubuntu/config.json" ]]; then #Changing portal route to the proper one in the config file muuktestRoute=$(cat /home/ubuntu/config.json | jq -r '.BERoute') echo $muuktestRoute - if [[ "$muuktestRoute" != null ]]; then + if [[ "$muuktestRoute" != "null" ]]; then #Change the BE route in the mkcli.py file sudo sed -i "s_https://portal.muuktest.com:8081_"$muuktestRoute"_" /home/ubuntu/projects/executor/mkcli.py fi # Adding the cloudKey in the mkcloud.py file cloudKey=$(cat /home/ubuntu/config.json | jq -r '.cloudKey') - if [[ "$cloudKey" != null ]]; then + if [[ "$cloudKey" != "null" ]]; then sudo sed -i '$ a def getCloudKey():' /home/ubuntu/projects/executor/mkcloud.py sudo sed -i "$ a \ \ return('$cloudKey')" /home/ubuntu/projects/executor/mkcloud.py fi