GHA workflow - Stage 2 Test 1 [skip travis]

This commit is contained in:
Mitchell Krog 2021-07-05 10:03:05 +02:00
parent fe51247d01
commit 14923be847
No known key found for this signature in database
GPG key ID: E02E9D10427B6A43
2 changed files with 23 additions and 14 deletions

View file

@ -62,6 +62,15 @@ jobs:
./dev-tools/test-blocker-rate-limiting.sh
./dev-tools/test-blocker-whitelist.sh
- name: Test Blocker - Stage 2
shell: bash
run: |
./dev-tools/install-nginx-2.sh
#./dev-tools/test-nginx-2.sh
#./dev-tools/install-nginx-3.sh
#./dev-tools/test-nginx-3.sh
#./dev-tools/test-setupngxblocker.sh
- name: Debug
shell: bash
run: |

View file

@ -16,6 +16,8 @@
# #
##############################################################################
export TERM=xterm
# ------------------------------------------------------------------------------
# MIT License
# ------------------------------------------------------------------------------
@ -64,7 +66,7 @@ printf "\n"
echo "${bold}${green}---------------"
echo "${bold}${green}Reloading Nginx"
echo "${bold}${green}---------------"
sudo nginx -t && sudo nginx -s reload
sudo nginx -t && sudo systemctl reload nginx
}
waitforReload () {
@ -100,9 +102,9 @@ printf "\n"
}
activateVHost () {
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/default.vhost /etc/nginx/sites-available/default.vhost
sudo cp ./dev-tools/default.vhost /etc/nginx/sites-available/default.vhost
sudo ln -s /etc/nginx/sites-available/default.vhost /etc/nginx/sites-enabled/default.vhost
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/index.html /var/www/html/index.html
sudo cp ./dev-tools/index.html /var/www/html/index.html
echo "${bold}${yellow}---------------------------------------------"
echo "${bold}${yellow}Activating default.vhost and linking to Nginx"
echo "${bold}${yellow}---------------------------------------------"
@ -123,8 +125,7 @@ echo "${bold}${magenta}--------------------------"
echo "${bold}${magenta}Execute install-ngxblocker"
echo "${bold}${magenta}--------------------------"
printf "\n"
cd /usr/sbin
sudo bash ./install-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d
sudo bash /usr/sbin/install-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d
}
runsetupngxblocker1 () {
@ -133,8 +134,7 @@ echo "${bold}${magenta}------------------------"
echo "${bold}${magenta}Execute setup-ngxblocker"
echo "${bold}${magenta}------------------------"
printf "\n"
cd /usr/sbin
sudo bash ./setup-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d
sudo bash /usr/sbin/setup-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/bots.d
}
makeScriptsExecutable () {
@ -148,7 +148,7 @@ printf "\n"
echo "${bold}${magenta}------------------------------"
echo "${bold}${magenta}Copy nginx.conf to /etc/nginx/"
echo "${bold}${magenta}------------------------------"
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/nginx.conf-newformat /etc/nginx/nginx.conf
sudo cp ./dev-tools/test_units/nginx.conf-newformat /etc/nginx/nginx.conf
}
loadNginxConf () {
@ -164,7 +164,7 @@ printf "\n"
echo "${bold}${yellow}----------------------------------------------------"
echo "${bold}${yellow}Copy older globalblacklist.conf file to force update"
echo "${bold}${yellow}----------------------------------------------------"
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/globalblacklist-dummy.conf /usr/local/nginx/conf.d/globalblacklist.conf
sudo cp ./dev-tools/globalblacklist-dummy.conf /usr/local/nginx/conf.d/globalblacklist.conf
}
forceUpdateTest2 () {
@ -192,7 +192,7 @@ echo "${bold}${yellow}----------------------------------------------------------
echo "${bold}${yellow}Make sure we test with latest generated globalblacklist.conf"
echo "${bold}${yellow}------------------------------------------------------------"
printf "\n"
sudo cp ${TRAVIS_BUILD_DIR}/conf.d/globalblacklist.conf /usr/local/nginx/conf.d/globalblacklist.conf
sudo cp ./conf.d/globalblacklist.conf /usr/local/nginx/conf.d/globalblacklist.conf
}
backupConfFiles () {
@ -201,10 +201,10 @@ echo "${bold}${green}-------------------------------------------------------"
echo "${bold}${green}Backup all conf files and folders used during this test"
echo "${bold}${green}-------------------------------------------------------"
printf "\n"
sudo cp /usr/local/nginx/bots.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/test2_conf_files/bots.d/
sudo cp /usr/local/nginx/conf.d/* ${TRAVIS_BUILD_DIR}/.dev-tools/test2_conf_files/conf.d/
sudo cp /etc/nginx/sites-available/default.vhost ${TRAVIS_BUILD_DIR}/.dev-tools/test2_conf_files/default.vhost
sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/test2_conf_files/nginx.conf
sudo cp /usr/local/nginx/bots.d/* ./dev-tools/test2_conf_files/bots.d/
sudo cp /usr/local/nginx/conf.d/* ./dev-tools/test2_conf_files/conf.d/
sudo cp /etc/nginx/sites-available/default.vhost ./dev-tools/test2_conf_files/default.vhost
sudo cp /etc/nginx/nginx.conf ./dev-tools/test2_conf_files/nginx.conf
}