diff --git a/appspec.yml b/appspec.yml index 79f6ba0..eae65d6 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 - timeout: 300 - runas: root + # ApplicationStop: + # - location: deploy_scripts/stop_services + # timeout: 300 + # runas: root diff --git a/build.gradle b/build.gradle index 47671a7..30da69b 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.90' geckoDriverVersion = '0.23.0' } } 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..f8a778f --- /dev/null +++ b/deploy_scripts/config_files @@ -0,0 +1,24 @@ +#!/bin/bash +#Changing the executor permissions +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 +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/config.json | jq -r '.BERoute') + echo $muuktestRoute + 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 + 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 diff --git a/scripts/install_dependencies b/deploy_scripts/install_dependencies similarity index 52% rename from scripts/install_dependencies rename to deploy_scripts/install_dependencies index 7e6b874..419eeb5 100644 --- a/scripts/install_dependencies +++ b/deploy_scripts/install_dependencies @@ -8,14 +8,15 @@ 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 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 +#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 diff --git a/scripts/start_services b/deploy_scripts/start_services similarity index 73% rename from scripts/start_services rename to deploy_scripts/start_services index e2d58ea..9b764c6 100644 --- a/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 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