theoden avatar theoden committed 9fcd994

At moment, nginx 1.2 and uwsgi 1.2 are successfully **installed** in Squeeze.
See UwsgiPrepareTest

Comments (0)

Files changed (2)

fab_deploy/system.py

         install_sudo()
 
     setup_backports()
+    setup_package_sources()
     install_software()
 
 @task
         return
 
     sudo("echo 'deb %s' > /etc/apt/sources.list.d/backports.sources.list" % backports[os])
+
+@task
+@utils.run_as_sudo
+def setup_package_sources():
+    """ Adds additional repos to apt sources. """
+    os = utils.detect_os()
+    nginx = {
+        'lucid': 'http://nginx.org/packages/ubuntu/ lucid nginx',
+        'squeeze': 'http://nginx.org/packages/debian/ squeeze nginx',
+    }
+    if os in nginx:
+        run('wget -O ./nginx_signing.key http://nginx.org/keys/nginx_signing.key')
+        sudo('sudo apt-key add ./nginx_signing.key')
+        sudo("echo 'deb %s' > /etc/apt/sources.list.d/nginx.list" % nginx[os])
+    uwsgi = {
+        'lucid': 'http://ppa.launchpad.net/uwsgi/release/ubuntu lucid main',
+        'squeeze': 'http://ftp.ru.debian.org/debian testing main contrib non-free',
+    }
+    if os in uwsgi:
+        sudo("echo 'deb %s' > /etc/apt/sources.list.d/uwsgi.list" % uwsgi[os])
+    if os=='squeeze':
+        sudo('echo \'APT::Default-Release "stable";\' > /etc/apt/apt.conf.d/default')
     with settings(warn_only=True):
         sudo('aptitude update')
         env.conf._APTITUDE_UPDATED = True
 
+
 @task
 @utils.run_as_sudo
 def create_linux_account(pub_key_file, username=None):

fab_deploy_tests/tests/__init__.py

 from .crontab import *
 from .deploy import *
 from .virtualenv import *
+from .uwsgi_prepare import *
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.