Add WOTemplate on other nginx config
This commit is contained in:
131
.travis.yml
131
.travis.yml
@@ -1,65 +1,66 @@
|
|||||||
sudo: required
|
sudo: required
|
||||||
dist: xenial
|
dist: xenial
|
||||||
|
|
||||||
language: bash
|
language: bash
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
slack: wordops:MyZBNbI7JfhbAi3YyFckMdaa
|
slack: wordops:MyZBNbI7JfhbAi3YyFckMdaa
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
update: true
|
update: true
|
||||||
|
|
||||||
git:
|
git:
|
||||||
quiet: true
|
quiet: true
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- rm -rf ~/.gnupg
|
- rm -rf ~/.gnupg
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- sudo rm -rf /etc/mysql
|
- sudo rm -rf /etc/mysql
|
||||||
- sudo bash -c 'echo example.com > /etc/hostname'
|
- sudo bash -c 'echo example.com > /etc/hostname'
|
||||||
- sudo apt-get -qq purge mysql* graphviz* redis*
|
- sudo apt-get -qq purge mysql* graphviz* redis*
|
||||||
- sudo apt-get -qq autoremove --purge
|
- sudo apt-get -qq autoremove --purge
|
||||||
- unset LANG
|
- unset LANG
|
||||||
- sudo apt-get install --assume-yes --quiet git python3-setuptools python3-dev python3-apt ccze tree
|
- sudo apt-get install --assume-yes --quiet git python3-setuptools python3-dev python3-apt ccze tree
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- lsb_release -a
|
- lsb_release -a
|
||||||
- sudo bash -c 'echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > /home/travis/.gitconfig'
|
- sudo bash -c 'echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > /home/travis/.gitconfig'
|
||||||
- sudo echo "Travis Banch = $TRAVIS_BRANCH"
|
- sudo echo "Travis Banch = $TRAVIS_BRANCH"
|
||||||
- sed -i 's/# "nose"/"nose"/g' setup.py
|
- sed -i 's/# "nose"/"nose"/g' setup.py
|
||||||
- sed -i 's/# "coverage"/"coverage"/g' setup.py
|
- sed -i 's/# "coverage"/"coverage"/g' setup.py
|
||||||
- sed -i 's/# "Sphinx >= 1.0"/"Sphinx >= 1.0"/g' setup.py
|
- sed -i 's/# "Sphinx >= 1.0"/"Sphinx >= 1.0"/g' setup.py
|
||||||
- sudo bash install --travis
|
- sudo bash install --travis
|
||||||
- sudo wo --help && sudo wo stack install && sudo wo stack install --proftpd
|
- sudo wo --help && sudo wo stack install && sudo wo stack install --proftpd
|
||||||
- sudo wo site create html.net --html && sudo wo site create php.com --php && sudo wo site create mysql.com --mysql && sudo wo site create proxy.com --proxy=127.0.0.1:3000
|
- sudo wo site create html.net --html && sudo wo site create php.com --php && sudo wo site create mysql.com --mysql && sudo wo site create proxy.com --proxy=127.0.0.1:3000
|
||||||
- sudo wo site create wp1.com --wp && sudo wo site create wpsc1.net --wpsc && sudo wo site create wpfc1.com --wpfc
|
- sudo wo site create wp1.com --wp && sudo wo site create wpsc1.net --wpsc && sudo wo site create wpfc1.com --wpfc
|
||||||
- sudo wo site create wpsc-php73.net --wpsc --php73 && sudo wo site create wpfc-php73.net --wpfc --php73
|
- sudo wo site create wpsc-php73.net --wpsc --php73 && sudo wo site create wpfc-php73.net --wpfc --php73
|
||||||
- sudo wo site create wprocket.net --wprocket && sudo wo site create wprocket-php73.net --wprocket --php73
|
- sudo wo site create wprocket.net --wprocket && sudo wo site create wprocket-php73.net --wprocket --php73
|
||||||
- sudo wo site create wpce.net --wpce && sudo wo site create wpce-php73.net --wpce --php73
|
- sudo wo site create wpce.net --wpce && sudo wo site create wpce-php73.net --wpce --php73
|
||||||
- sudo wo site create wpredis.net --wpredis && sudo wo site create wpredis-php73.net --wpredis --php73
|
- sudo wo site create wpredis.net --wpredis && sudo wo site create wpredis-php73.net --wpredis --php73
|
||||||
- sudo wo site create wpsubdir1.com --wpsubdir && sudo wo site create wpsubdir-php73.com --wpsubdir --php73
|
- sudo wo site create wpsubdir1.com --wpsubdir && sudo wo site create wpsubdir-php73.com --wpsubdir --php73
|
||||||
|
|
||||||
- sudo wo site create wpsubdirwpsc1.com --wpsubdir --wpsc && sudo wo site create wpsubdirwpsc2.com --wpsubdir --wpfc && sudo wo site create wpsubdirwpsc1-php73.com --wpsubdir --wpsc --php73 && sudo wo site create wpsubdirwpsc2-php73.com --wpsubdir --wpfc --php73
|
- sudo wo site create wpsubdirwpsc1.com --wpsubdir --wpsc && sudo wo site create wpsubdirwpsc2.com --wpsubdir --wpfc && sudo wo site create wpsubdirwpsc1-php73.com --wpsubdir --wpsc --php73 && sudo wo site create wpsubdirwpsc2-php73.com --wpsubdir --wpfc --php73
|
||||||
- sudo wo site create wpsubdomain1.com --wpsubdomain && sudo wo site create wpsubdomain1-php73.com --wpsubdomain --php73 && sudo wo site create wpsubdomainwpsc.org --wpsubdomain --wpsc && sudo wo site create wpsubdomainwpfc.org --wpsubdomain --wpfc && sudo wo site create wpsubdomainwpfc2.in --wpfc --wpsubdomain
|
- sudo wo site create wpsubdomain1.com --wpsubdomain && sudo wo site create wpsubdomain1-php73.com --wpsubdomain --php73 && sudo wo site create wpsubdomainwpsc.org --wpsubdomain --wpsc && sudo wo site create wpsubdomainwpfc.org --wpsubdomain --wpfc && sudo wo site create wpsubdomainwpfc2.in --wpfc --wpsubdomain
|
||||||
|
|
||||||
- sudo wo site create 1.com --html && sudo wo site create 2.com --php && sudo wo site create 3.com --mysql
|
- sudo wo site create 1.com --html && sudo wo site create 2.com --php && sudo wo site create 3.com --mysql
|
||||||
- sudo wo site update 1.com --wp && sudo wo site update 2.com --php73 && sudo wo site update 3.com --php73 && sudo wo site update 1.com --wpfc && sudo wo site update 1.com --wpsc && sudo wo site update 1.com --wpredis
|
- sudo wo site update 1.com --wp && sudo wo site update 2.com --php73 && sudo wo site update 3.com --php73 && sudo wo site update 1.com --wpfc && sudo wo site update 1.com --wpsc && sudo wo site update 1.com --wpredis
|
||||||
- sudo wp --allow-root --info
|
- sudo wp --allow-root --info
|
||||||
- sudo wo info
|
- sudo wo info
|
||||||
- sudo cat /etc/nginx/nginx.conf
|
- sudo cat /etc/nginx/nginx.conf
|
||||||
- sudo tree -L 2 /etc/nginx
|
- sudo tree -L 2 /etc/nginx
|
||||||
- sudo cat /etc/mysql/my.cnf
|
- sudo tree -L 2 /var/www
|
||||||
- sudo wo stack upgrade --nginx --force
|
- sudo cat /etc/mysql/my.cnf
|
||||||
- sudo wo stack upgrade --php --force
|
- sudo wo stack upgrade --nginx --force
|
||||||
- sudo wo stack upgrade --netdata --force
|
- sudo wo stack upgrade --php --force
|
||||||
- sudo wo stack upgrade --phpmyadmin --force
|
- sudo wo stack upgrade --netdata --force
|
||||||
- sudo wo stack upgrade --composer --force
|
- sudo wo stack upgrade --phpmyadmin --force
|
||||||
- sudo wo stack upgrade --dashboard --force
|
- sudo wo stack upgrade --composer --force
|
||||||
- sudo wo update --travis
|
- sudo wo stack upgrade --dashboard --force
|
||||||
- sudo wo stack status
|
- sudo wo update --travis
|
||||||
- sudo tar -I pigz -cf wordops.tar.gz /var/log/wo
|
- sudo wo stack status
|
||||||
- curl --progress-bar --upload-file wordops.tar.gz https://transfer.vtbox.net/$(basename "wordops.tar.gz") && echo "" | sudo tee -a $HOME/.transfer.log && echo ""
|
- sudo tar -I pigz -cf wordops.tar.gz /var/log/wo
|
||||||
- echo "yes" | sudo wo stack purge --all --force
|
- curl --progress-bar --upload-file wordops.tar.gz https://transfer.vtbox.net/$(basename "wordops.tar.gz") && echo "" | sudo tee -a $HOME/.transfer.log && echo ""
|
||||||
- sudo bash install --purge
|
- echo "yes" | sudo wo stack purge --all --force
|
||||||
|
- sudo bash install --purge
|
||||||
|
|||||||
@@ -253,81 +253,53 @@ def post_pref(self, apt_packages, packages):
|
|||||||
.format(ngxcom),
|
.format(ngxcom),
|
||||||
'wpsc.mustache', data)
|
'wpsc.mustache', data)
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
WOTemplate.tmpl_render(self,
|
||||||
'file /etc/nginx/common/wprocket-php72.conf')
|
'{0}/wprocket-php72.conf'
|
||||||
wo_nginx = open('/etc/nginx/common/wprocket-php72.conf',
|
.format(ngxcom),
|
||||||
encoding='utf-8', mode='w')
|
'wprocket.mustache', data)
|
||||||
self.app.render((data), 'wprocket.mustache',
|
|
||||||
out=wo_nginx)
|
|
||||||
wo_nginx.close()
|
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
WOTemplate.tmpl_render(self,
|
||||||
'file /etc/nginx/common/wpce-php72.conf')
|
'{0}/wpce-php72.conf'
|
||||||
wo_nginx = open('/etc/nginx/common/wpce-php72.conf',
|
.format(ngxcom),
|
||||||
encoding='utf-8', mode='w')
|
'wpce.mustache', data)
|
||||||
self.app.render((data), 'wpce.mustache',
|
|
||||||
out=wo_nginx)
|
|
||||||
wo_nginx.close()
|
|
||||||
|
|
||||||
# PHP 7.3 conf
|
# PHP 7.3 conf
|
||||||
if os.path.isdir("/etc/nginx/common"):
|
if os.path.isdir("/etc/nginx/common"):
|
||||||
data = dict(upstream="php73")
|
data = dict(upstream="php73")
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
WOTemplate.tmpl_render(self,
|
||||||
'file /etc/nginx/common/php73.conf')
|
'{0}/php73.conf'
|
||||||
wo_nginx = open('/etc/nginx/common/php73.conf',
|
.format(ngxcom),
|
||||||
encoding='utf-8', mode='w')
|
'php.mustache', data)
|
||||||
self.app.render((data), 'php.mustache',
|
|
||||||
out=wo_nginx)
|
|
||||||
wo_nginx.close()
|
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
WOTemplate.tmpl_render(self,
|
||||||
'file /etc/nginx/common/wpcommon-php73.conf')
|
'{0}/redis-php73.conf'
|
||||||
wo_nginx = open('/etc/nginx/common/wpcommon-php73.conf',
|
.format(ngxcom),
|
||||||
encoding='utf-8', mode='w')
|
'redis.mustache', data)
|
||||||
self.app.render((data), 'wpcommon.mustache',
|
|
||||||
out=wo_nginx)
|
|
||||||
wo_nginx.close()
|
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
WOTemplate.tmpl_render(self,
|
||||||
'file /etc/nginx/common/wpfc-php73.conf')
|
'{0}/wpcommon-php73.conf'
|
||||||
wo_nginx = open('/etc/nginx/common/wpfc-php73.conf',
|
.format(ngxcom),
|
||||||
encoding='utf-8', mode='w')
|
'wpcommon.mustache', data)
|
||||||
self.app.render((data), 'wpfc.mustache',
|
|
||||||
out=wo_nginx)
|
|
||||||
wo_nginx.close()
|
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
WOTemplate.tmpl_render(self,
|
||||||
'file /etc/nginx/common/wpsc-php73.conf')
|
'{0}/wpfc-php73.conf'
|
||||||
wo_nginx = open('/etc/nginx/common/wpsc-php73.conf',
|
.format(ngxcom),
|
||||||
encoding='utf-8', mode='w')
|
'wpfc.mustache', data)
|
||||||
self.app.render((data), 'wpsc.mustache',
|
WOTemplate.tmpl_render(self,
|
||||||
out=wo_nginx)
|
'{0}/wpsc-php73.conf'
|
||||||
wo_nginx.close()
|
.format(ngxcom),
|
||||||
|
'wpsc.mustache', data)
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
WOTemplate.tmpl_render(self,
|
||||||
'file /etc/nginx/common/wprocket-php73.conf')
|
'{0}/wprocket-php73.conf'
|
||||||
wo_nginx = open('/etc/nginx/common/wprocket-php73.conf',
|
.format(ngxcom),
|
||||||
encoding='utf-8', mode='w')
|
'wprocket.mustache', data)
|
||||||
self.app.render((data), 'wprocket.mustache',
|
|
||||||
out=wo_nginx)
|
|
||||||
wo_nginx.close()
|
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
WOTemplate.tmpl_render(self,
|
||||||
'file /etc/nginx/common/wpce-php73.conf')
|
'{0}/wpce-php73.conf'
|
||||||
wo_nginx = open('/etc/nginx/common/wpce-php73.conf',
|
.format(ngxcom),
|
||||||
encoding='utf-8', mode='w')
|
'wpce.mustache', data)
|
||||||
self.app.render((data), 'wpce.mustache',
|
|
||||||
out=wo_nginx)
|
|
||||||
wo_nginx.close()
|
|
||||||
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
|
||||||
'file /etc/nginx/common/redis-php73.conf')
|
|
||||||
wo_nginx = open('/etc/nginx/common/redis-php73.conf',
|
|
||||||
encoding='utf-8', mode='w')
|
|
||||||
self.app.render((data), 'redis.mustache',
|
|
||||||
out=wo_nginx)
|
|
||||||
wo_nginx.close()
|
|
||||||
|
|
||||||
with open("/etc/nginx/common/release",
|
with open("/etc/nginx/common/release",
|
||||||
"w") as release_file:
|
"w") as release_file:
|
||||||
@@ -337,32 +309,19 @@ def post_pref(self, apt_packages, packages):
|
|||||||
|
|
||||||
# Following files should not be overwrited
|
# Following files should not be overwrited
|
||||||
|
|
||||||
if not os.path.isfile('/etc/nginx/common/acl.conf'):
|
data = dict(webroot=ngxroot)
|
||||||
data = dict(webroot=ngxroot)
|
WOTemplate.tmpl_render(self,
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
'{0}/acl.conf'
|
||||||
'file /etc/nginx/common/acl.conf')
|
.format(ngxcom),
|
||||||
wo_nginx = open('/etc/nginx/common/acl.conf',
|
'acl.mustache', data, overwrite=False)
|
||||||
encoding='utf-8', mode='w')
|
WOTemplate.tmpl_render(self,
|
||||||
self.app.render((data), 'acl.mustache',
|
'{0}/blockips.conf'
|
||||||
out=wo_nginx)
|
.format(ngxcnf),
|
||||||
wo_nginx.close()
|
'blockips.mustache', data, overwrite=False)
|
||||||
if not os.path.isfile('{0}/blockips.conf'.format(ngxcnf)):
|
WOTemplate.tmpl_render(self,
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
'{0}/fastcgi.conf'
|
||||||
'file {0}/blockips.conf'.format(ngxcnf))
|
.format(ngxcnf),
|
||||||
wo_nginx = open('{0}/blockips.conf'.format(ngxcnf),
|
'fastcgi.mustache', data, overwrite=False)
|
||||||
encoding='utf-8', mode='w')
|
|
||||||
self.app.render(
|
|
||||||
(data), 'blockips.mustache', out=wo_nginx)
|
|
||||||
wo_nginx.close()
|
|
||||||
|
|
||||||
if not os.path.isfile('{0}/fastcgi.conf'.format(ngxcnf)):
|
|
||||||
Log.debug(self, 'Writting the nginx configuration to '
|
|
||||||
'file {0}/fastcgi.conf'.format(ngxcnf))
|
|
||||||
wo_nginx = open('{0}/fastcgi.conf'.format(ngxcnf),
|
|
||||||
encoding='utf-8', mode='w')
|
|
||||||
self.app.render(
|
|
||||||
(data), 'fastcgi.mustache', out=wo_nginx)
|
|
||||||
wo_nginx.close()
|
|
||||||
|
|
||||||
# add redis cache format if not already done
|
# add redis cache format if not already done
|
||||||
if (os.path.isfile("/etc/nginx/nginx.conf") and
|
if (os.path.isfile("/etc/nginx/nginx.conf") and
|
||||||
|
|||||||
Reference in New Issue
Block a user