gitlist installation scripted in fabfile
This commit is contained in:
43
jenkins/fabfile.py
vendored
43
jenkins/fabfile.py
vendored
@@ -1,16 +1,49 @@
|
||||
from __future__ import with_statement
|
||||
from fabric.api import settings, abort, run, cd, env
|
||||
|
||||
env.hosts = ['192.241.189.7']
|
||||
env.hosts = ['projects.irrsinn.net']
|
||||
env.user = 'root'
|
||||
|
||||
def apache_config():
|
||||
with cd('/etc/apache2/sites-available'):
|
||||
put('projects.irrsinn.net-vhost', 'projects.irrsinn.net')
|
||||
|
||||
def base_installs():
|
||||
run('apt-get update')
|
||||
run('apt-get install -y tomcat7 default-jdk git gitweb vim nano php5 libapache2-mod-php5 php5-mcrypt varnish')
|
||||
|
||||
def deploy_clean_jenkins():
|
||||
run('wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war')
|
||||
run('cp jenkins.war /var/lib/tomcat7/webapps')
|
||||
run('chmod -R 0777 /usr/share/tomcat7')
|
||||
|
||||
def gitlist_install():
|
||||
run('mkdir -r /var/www/projects.irrsinn.net/git')
|
||||
run('mkdir /root/repositories')
|
||||
|
||||
with cd('/root/repositories'):
|
||||
#Get repos somehow
|
||||
run('chmod -R 0755 .')
|
||||
|
||||
with cd('/var/www/projects.irrsinn.net/git'):
|
||||
run('chmod -R 0755 .')
|
||||
run('mkdir cache')
|
||||
run('chmod 0777 cache')
|
||||
put('gitlist-config.ini', 'config.ini', mode=0755)
|
||||
|
||||
run('apache2ctl -k restart')
|
||||
|
||||
def projects_install():
|
||||
gitlist_install()
|
||||
apache_config()
|
||||
varnish_config()
|
||||
|
||||
def setup_server():
|
||||
run('apt-get update')
|
||||
run('apt-get install -y tomcat7 default-jdk git')
|
||||
run('mkdir /var')
|
||||
run('/etc/init.d/tomcat7 start')
|
||||
base_installs()
|
||||
tomcat_install()
|
||||
projects_install()
|
||||
|
||||
def tomcat_install():
|
||||
run('/etc/init.d/tomcat7 start')
|
||||
|
||||
def varnish_config():
|
||||
|
||||
6
jenkins/gitlist-config.ini
Normal file
6
jenkins/gitlist-config.ini
Normal file
@@ -0,0 +1,6 @@
|
||||
[git]
|
||||
client = '/usr/bin/git' ; Your git executable path
|
||||
repositories = '/root/repositories/' ; Path to your repositories (with ending slash)
|
||||
|
||||
[app]
|
||||
baseurl = 'http://projects.irrsinn.net/git' ; Base URL of the application (without ending slash)
|
||||
25
jenkins/projects.irrsinn.net-vhost
Normal file
25
jenkins/projects.irrsinn.net-vhost
Normal file
@@ -0,0 +1,25 @@
|
||||
<VirtualHost *:80>
|
||||
ServerAdmin averymd@irrsinn.net
|
||||
|
||||
ServerName projects.irrsinn.net
|
||||
DocumentRoot /var/www/projects.irrsinn.net
|
||||
<Directory /var/www/projects.irrsinn.net>
|
||||
Options FollowSymLinks
|
||||
AllowOverride None
|
||||
</Directory>
|
||||
<Directory /var/www/projects.irrsinn.net/git>
|
||||
Options Indexes FollowSymLinks MultiViews
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
allow from all
|
||||
</Directory>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit,
|
||||
# alert, emerg.
|
||||
LogLevel warn
|
||||
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
|
||||
</VirtualHost>
|
||||
Reference in New Issue
Block a user