Add Versioning Info to README

This commit is contained in:
Mitchell Krog 2019-06-29 17:21:45 +02:00
parent 20f1137b41
commit 78ff0112a6
No known key found for this signature in database
GPG key ID: C243C388553EDE5D
6 changed files with 58 additions and 1 deletions

View file

@ -206,6 +206,10 @@ echo "${bold}${magenta}------------------------------"
sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/nginx.conf-newformat /etc/nginx/nginx.conf sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test_units/nginx.conf-newformat /etc/nginx/nginx.conf
} }
getnginxversion () {
sudo nginx -v &> ${TRAVIS_BUILD_DIR}/.dev-tools/nginxv1.txt
}
# ------------------ # ------------------
# Start Installation # Start Installation
# ------------------ # ------------------
@ -236,6 +240,7 @@ waitforReload
activateLatestBlacklist activateLatestBlacklist
reloadNginX reloadNginX
backupConfFiles backupConfFiles
getnginxversion
# ---------------------- # ----------------------
# Exit With Error Number # Exit With Error Number

View file

@ -88,12 +88,23 @@ sudo cp ${TRAVIS_BUILD_DIR}/.dev-tools/test1_conf_backup_nginxconf/nginx13.conf
sudo apt-get purge nginx-full sudo apt-get purge nginx-full
sudo apt-get purge nginx-common sudo apt-get purge nginx-common
sudo apt-get purge nginx* sudo apt-get purge nginx*
# Mainline from PPA
mainstreamnginx=development mainstreamnginx=development
sudo add-apt-repository -y ppa:nginx/${mainstreamnginx} sudo add-apt-repository -y ppa:nginx/${mainstreamnginx}
sudo apt-get update sudo apt-get update
sudo apt-get install -y --assume-yes nginx-full sudo apt-get install -y --assume-yes nginx-full
sudo nginx -V sudo nginx -V
sudo nginx -t && sudo nginx -s reload sudo nginx -t && sudo nginx -s reload
# Mainline from Nginx
#echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx
#deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" > /etc/apt/sources.list.d/nginx.list
#wget https://nginx.org/keys/nginx_signing.key -O - | sudo apt-key add -
#apt-get -y update
#apt-get -y install nginx
#sudo nginx -V
#sudo nginx -t && sudo nginx -s reload
} }
cleanupNginx1 () { cleanupNginx1 () {
@ -230,6 +241,13 @@ sudo cp /etc/nginx/sites-available/default.vhost ${TRAVIS_BUILD_DIR}/.dev-tools/
sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/test4_conf_files/nginx.conf sudo cp /etc/nginx/nginx.conf ${TRAVIS_BUILD_DIR}/.dev-tools/test4_conf_files/nginx.conf
} }
getnginxversion () {
sudo nginx -v &> ${TRAVIS_BUILD_DIR}/.dev-tools/nginxv2.txt
}
# -----------------
# Trigger Functions
# -----------------
installNginxMainstream installNginxMainstream
checkDirectories checkDirectories
@ -259,6 +277,7 @@ runsetupngxblocker1
reloadNginX reloadNginX
waitforReload waitforReload
backupConfFiles backupConfFiles
getnginxversion
# ---------------------- # ----------------------
# Exit With Error Number # Exit With Error Number

View file

@ -68,6 +68,10 @@ _inputdbA=/tmp/lastupdated.db
_tmpnginxA=tmpnginxA _tmpnginxA=tmpnginxA
_startmarker="_______________" _startmarker="_______________"
_endmarker="____________________" _endmarker="____________________"
_startmarker2="##----------- TESTED ON ------------"
_endmarker2="##----------------------------------"
nginxv1="1.10"
nginxv2=$(cat ${TRAVIS_BUILD_DIR}/.dev-tools/nginxv2.txt)
# --------- # ---------
# FUNCTIONS # FUNCTIONS
@ -96,6 +100,29 @@ IN
rm ${_inputdbA} rm ${_inputdbA}
} }
updateReadme2 () {
# **********************************************
# PRINT NGINX VERSION INFORMATION INTO README.md
# **********************************************
printf '%s\n%s\n%s\n%s' "$_startmarker2" "## ${nginxv1}" "## > ${nginxv2}" "$_endmarker2" >> "$_tmpnginxA"
mv ${_tmpnginxA} ${_inputdbA}
ed -s ${_inputdbA}<<\IN
1,/##----------- TESTED ON ------------/d
/##----------------------------------/,$d
,d
.r /home/travis/build/mitchellkrogza/nginx-ultimate-bad-bot-blocker/README.md
/##----------- TESTED ON ------------/x
.t.
.,/##----------------------------------/-d
#,p
#,p used to print output replaced with w below to write
w /home/travis/build/mitchellkrogza/nginx-ultimate-bad-bot-blocker/README.md
q
IN
rm ${_inputdbA}
}
updateAutoConfiguration () { updateAutoConfiguration () {
# **************************************************** # ****************************************************
# PRINT VERSION INFORMATION INTO AUTO-CONFIGURATION.md # PRINT VERSION INFORMATION INTO AUTO-CONFIGURATION.md
@ -173,6 +200,7 @@ updateReadme
updateAutoConfiguration updateAutoConfiguration
updateManualConfiguration updateManualConfiguration
updateGoogleGhostSpam updateGoogleGhostSpam
updateReadme2
echo "${bold}${green}------------------------" echo "${bold}${green}------------------------"
echo "${bold}${green}All README Files Updated" echo "${bold}${green}All README Files Updated"

0
.dev-tools/nginxv1.txt Normal file
View file

1
.dev-tools/nginxv2.txt Normal file
View file

@ -0,0 +1 @@
nginx version: nginx/1.15.8

View file

@ -23,9 +23,13 @@ ____________________
************************************************ ************************************************
- Created by: https://github.com/mitchellkrogza for use on Nginx Web Server https://www.nginx.com/ - Created by: https://github.com/mitchellkrogza for use on Nginx Web Server https://www.nginx.com/
- Copyright Mitchell Krog <mitchellkrog@gmail.com> - Copyright Mitchell Krog <mitchellkrog@gmail.com>
- Tested on Nginx **1.10 > 1.16**
************************************************ ************************************************
##----------- TESTED ON ------------
##----------------------------------
Not Using Nginx? See the [![Get the APACHE ULTIMATE BAD BOT BLOCKER](https://img.shields.io/badge/APACHE%20-%20ULTIMATE%20BAD%20BOT%20BLOCKER%20%E2%9B%94-blue.svg)](https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker) Not Using Nginx? See the [![Get the APACHE ULTIMATE BAD BOT BLOCKER](https://img.shields.io/badge/APACHE%20-%20ULTIMATE%20BAD%20BOT%20BLOCKER%20%E2%9B%94-blue.svg)](https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker)
Please make sure you are subscribed to Github Notifications to be notified when the blocker is updated or when any important or mission critical (potentially breaking) changes may take place. Please make sure you are subscribed to Github Notifications to be notified when the blocker is updated or when any important or mission critical (potentially breaking) changes may take place.