mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 02:29:58 +00:00
Modify Travis Build Tests
- Force testing of latest generated blacklist too to check for errors. - Changed order of scripts in build process.
This commit is contained in:
parent
0d7c1b7c5d
commit
53988d8398
5 changed files with 131 additions and 32 deletions
84
.dev-tools/generate-files.sh
Executable file
84
.dev-tools/generate-files.sh
Executable file
|
@ -0,0 +1,84 @@
|
|||
#!/bin/bash
|
||||
# Travis CI Generating and Building for the Nginx Ultimate Bad Bot Blocker
|
||||
# Created by: Mitchell Krog (mitchellkrog@gmail.com)
|
||||
# Copyright: Mitchell Krog - https://github.com/mitchellkrogza
|
||||
# Repo Url: https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker
|
||||
|
||||
# MIT License
|
||||
|
||||
# Copyright (c) 2017 Mitchell Krog - mitchellkrog@gmail.com
|
||||
# https://github.com/mitchellkrogza
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
# *****************************************************
|
||||
# Set all our setup and deploy scripts to be executable
|
||||
# *****************************************************
|
||||
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/deploy-package.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-blacklist.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-files.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-robots.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-google-disavow.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-google-exclude.php
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-regex-format-referrers.php
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/modify-config-readme-files.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/modify-files-and-commit.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/run-curl-tests-1.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/run-curl-tests-2.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/prepare-robots-input.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/install-nginx-2.sh
|
||||
|
||||
cd $TRAVIS_BUILD_DIR
|
||||
|
||||
# ***************************************************
|
||||
# Modify our files with build and version information
|
||||
# ***************************************************
|
||||
|
||||
php ./.dev-tools/generate-regex-format-referrers.php
|
||||
sudo $TRAVIS_BUILD_DIR/.dev-tools/generate-blacklist.sh
|
||||
sudo $TRAVIS_BUILD_DIR/.dev-tools/modify-config-readme-files.sh
|
||||
sudo $TRAVIS_BUILD_DIR/.dev-tools/prepare-robots-input.sh
|
||||
sudo $TRAVIS_BUILD_DIR/.dev-tools/generate-robots.sh
|
||||
sudo $TRAVIS_BUILD_DIR/.dev-tools/generate-google-disavow.sh
|
||||
php ./.dev-tools/generate-google-exclude.php
|
||||
|
||||
|
||||
# MIT License
|
||||
|
||||
# Copyright (c) 2017 Mitchell Krog - mitchellkrog@gmail.com
|
||||
# https://github.com/mitchellkrogza
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
|
@ -186,25 +186,26 @@ sudo bash ./setup-ngxblocker -x
|
|||
printf '\n%s\n%s\n%s\n\n' "########################" "Force Reloading of Nginx" "########################"
|
||||
sudo service nginx reload
|
||||
|
||||
# *******************************************************
|
||||
# Make sure we test latest generated globalblacklist.conf
|
||||
# *******************************************************
|
||||
|
||||
printf '\n%s\n%s\n%s\n\n' "####################################################" "Copy latest generated globalblacklist.conf file to test for errors" "####################################################"
|
||||
sudo cp $TRAVIS_BUILD_DIR/conf.d/globalblacklist.conf /etc/nginx/conf.d/globalblacklist.conf
|
||||
|
||||
# *********************
|
||||
# Force reload of Nginx
|
||||
# *********************
|
||||
|
||||
printf '\n%s\n%s\n%s\n\n' "########################" "Force Reloading of Nginx" "########################"
|
||||
sudo service nginx reload
|
||||
|
||||
# **********************
|
||||
# Now Run our Curl Tests
|
||||
# **********************
|
||||
|
||||
printf '\n%s\n%s\n%s\n\n' "######################" "Now Run our Curl Tests" "######################"
|
||||
|
||||
# ***********************************************************
|
||||
# Set all our other setup and deploy scripts to be executable
|
||||
# ***********************************************************
|
||||
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/deploy-package.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-blacklist.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-robots.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-google-disavow.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-google-exclude.php
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/generate-regex-format-referrers.php
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/modify-config-readme-files.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/modify-files-and-commit.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/run-curl-tests-1.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/run-curl-tests-2.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/prepare-robots-input.sh
|
||||
sudo chmod +x $TRAVIS_BUILD_DIR/.dev-tools/install-nginx-2.sh
|
||||
|
||||
# ************************************************************
|
||||
# Copy all .conf files used in Test 1 to a folder for checking
|
||||
# ************************************************************
|
||||
|
|
|
@ -218,6 +218,25 @@ sudo bash ./setup-ngxblocker -x -c /usr/local/nginx/conf.d -b /usr/local/nginx/b
|
|||
|
||||
printf '\n%s\n%s\n%s\n\n' "########################" "Force Reloading of Nginx" "########################"
|
||||
sudo service nginx reload
|
||||
|
||||
# *******************************************************
|
||||
# Make sure we test latest generated globalblacklist.conf
|
||||
# *******************************************************
|
||||
|
||||
printf '\n%s\n%s\n%s\n\n' "####################################################" "Copy latest generated globalblacklist.conf file to test for errors" "####################################################"
|
||||
sudo cp $TRAVIS_BUILD_DIR/conf.d/globalblacklist.conf /usr/local/nginx/conf.d/globalblacklist.conf
|
||||
|
||||
# *********************
|
||||
# Force reload of Nginx
|
||||
# *********************
|
||||
|
||||
printf '\n%s\n%s\n%s\n\n' "########################" "Force Reloading of Nginx" "########################"
|
||||
sudo service nginx reload
|
||||
|
||||
# **********************
|
||||
# Now Run our Curl Tests
|
||||
# **********************
|
||||
|
||||
printf '\n%s\n%s\n%s\n\n' "######################" "Now Run our Curl Tests" "######################"
|
||||
|
||||
# ************************************************************
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
# Set Some Variables
|
||||
# ******************
|
||||
|
||||
#set -v
|
||||
|
||||
YEAR=$(date +"%Y")
|
||||
MONTH=$(date +"%m")
|
||||
cd $TRAVIS_BUILD_DIR
|
||||
|
@ -49,11 +47,6 @@ git remote rm origin
|
|||
|
||||
git remote add origin https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
|
||||
|
||||
# **********************************************************************************
|
||||
# List Remotes ONLY DURING testing - do not do this on live repo / possible key leak
|
||||
# git remote -v
|
||||
# ***********************************************************************************
|
||||
|
||||
# *********************
|
||||
# Set Our Git Variables
|
||||
# *********************
|
||||
|
@ -72,13 +65,15 @@ git checkout master
|
|||
# Modify our files with build and version information
|
||||
# ***************************************************
|
||||
|
||||
php ./.dev-tools/generate-regex-format-referrers.php
|
||||
sudo $TRAVIS_BUILD_DIR/.dev-tools/generate-blacklist.sh
|
||||
sudo $TRAVIS_BUILD_DIR/.dev-tools/modify-config-readme-files.sh
|
||||
sudo $TRAVIS_BUILD_DIR/.dev-tools/prepare-robots-input.sh
|
||||
sudo $TRAVIS_BUILD_DIR/.dev-tools/generate-robots.sh
|
||||
sudo $TRAVIS_BUILD_DIR/.dev-tools/generate-google-disavow.sh
|
||||
php ./.dev-tools/generate-google-exclude.php
|
||||
# Now Moved to an earlier phase of the build
|
||||
|
||||
#php ./.dev-tools/generate-regex-format-referrers.php
|
||||
#sudo $TRAVIS_BUILD_DIR/.dev-tools/generate-blacklist.sh
|
||||
#sudo $TRAVIS_BUILD_DIR/.dev-tools/modify-config-readme-files.sh
|
||||
#sudo $TRAVIS_BUILD_DIR/.dev-tools/prepare-robots-input.sh
|
||||
#sudo $TRAVIS_BUILD_DIR/.dev-tools/generate-robots.sh
|
||||
#sudo $TRAVIS_BUILD_DIR/.dev-tools/generate-google-disavow.sh
|
||||
#php ./.dev-tools/generate-google-exclude.php
|
||||
|
||||
# ***************************************************************
|
||||
# Gzip Our Latest Release So We can Include it the Travis Release
|
||||
|
@ -95,7 +90,6 @@ tar -czf bots.d.tar.gz -C $TRAVIS_BUILD_DIR/bots.d/ .
|
|||
git add -A
|
||||
git commit -am "V3.$YEAR.$MONTH.$TRAVIS_BUILD_NUMBER [ci skip]"
|
||||
|
||||
|
||||
# ***************************************************
|
||||
# Try pushing changes to Google Ghost Spam Repository
|
||||
# ***************************************************
|
||||
|
|
|
@ -34,6 +34,7 @@ install:
|
|||
- sudo apt-get install -y --assume-yes nginx-extras
|
||||
|
||||
script:
|
||||
- bash .dev-tools/generate-files.sh
|
||||
- bash .dev-tools/install-nginx-1.sh
|
||||
- bash .dev-tools/run-curl-tests-1.sh
|
||||
- bash .dev-tools/install-nginx-2.sh
|
||||
|
|
Loading…
Add table
Reference in a new issue