summaryrefslogtreecommitdiff
path: root/per-service
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2016-03-29 14:29:16 -0500
committerAndy Doan <andy.doan+gerrit@linaro.org>2016-04-01 16:04:19 +0000
commitce4302291c129586a082a6cbdb14c724e07ebf95 (patch)
tree8aebf42b98578553e62fdea9ab16a4c212879d03 /per-service
parent9ad14365bd1117d04cc7c3f2f8b58d2b60cf11ac (diff)
patchwork: move to common
Its mostly just moving/renaming files and then updating a few corresponding references to variable names. Change-Id: Ic5e2538a377a430ea5cc0a570ee8f6436be8bf1e Reviewed-on: https://review.linaro.org/11107 Reviewed-by: Andy Doan <andy.doan+gerrit@linaro.org>
Diffstat (limited to 'per-service')
-rw-r--r--per-service/patchwork/files/apache.conf51
-rw-r--r--per-service/patchwork/files/wsgi.py12
-rw-r--r--per-service/patchwork/group_vars/all17
-rw-r--r--per-service/patchwork/hosts3
l---------per-service/patchwork/roles/apache-site1
l---------per-service/patchwork/roles/django1
-rw-r--r--per-service/patchwork/roles/patchwork-pre-django/tasks/main.yml44
l---------per-service/patchwork/roles/postgres1
l---------per-service/patchwork/secrets1
-rw-r--r--per-service/patchwork/site.yml18
-rw-r--r--per-service/patchwork/templates/patches.cron.d4
-rw-r--r--per-service/patchwork/templates/patches.linaro.org_local_settings.py66
-rw-r--r--per-service/patchwork/templates/patches.opendataplane.org_local_settings.py54
-rw-r--r--per-service/patchwork/templates/patchwork.cron.d5
14 files changed, 0 insertions, 278 deletions
diff --git a/per-service/patchwork/files/apache.conf b/per-service/patchwork/files/apache.conf
deleted file mode 100644
index 4352ce5a..00000000
--- a/per-service/patchwork/files/apache.conf
+++ /dev/null
@@ -1,51 +0,0 @@
-<VirtualHost *:80>
- ServerName {{hostname}}
- ErrorLog /var/log/apache2/{{hostname}}-error.log
- CustomLog /var/log/apache2/{{hostname}}-acess.log combined
-
- DocumentRoot "{{install_base}}/{{hostname}}/project/htdocs"
-
- # Admin access should be always over SSL
- RewriteEngine On
- RewriteRule ^(/admin.*) https://{{hostname}}$1 [redirect=301,noescape,last]
-
- Alias /static/ "{{install_base}}/{{hostname}}/static/"
-
- <Directory "{{install_base}}/{{hostname}}/static/">
- Order allow,deny
- Allow from all
- Require all granted
- </Directory>
-
- WSGIScriptAlias / "{{install_base}}/{{hostname}}/wsgi.py"
- <Directory "{{install_base}}/{{hostname}}">
- Require all granted
- </Directory>
-</VirtualHost>
-
-<VirtualHost *:443>
- ServerName {{hostname}}
- ErrorLog /var/log/apache2/{{hostname}}-error.log
- CustomLog /var/log/apache2/{{hostname}}-acess.log combined
-
- SSLEngine On
- SSLCertificateFile {{ssl_cert}}
- SSLCertificateKeyFile {{ssl_key}}
- SSLCACertificateFile {{ssl_ca_cert}}
-
- DocumentRoot "{{install_base}}/{{hostname}}/project/htdocs"
-
- Alias /static/ "{{install_base}}/{{hostname}}/static/"
-
- <Directory "{{install_base}}/{{hostname}}/static/">
- Order allow,deny
- Allow from all
- Require all granted
- </Directory>
-
- WSGIPassAuthorization On
- WSGIScriptAlias / "{{install_base}}/{{hostname}}/wsgi.py"
- <Directory "{{install_base}}/{{hostname}}">
- Require all granted
- </Directory>
-</VirtualHost>
diff --git a/per-service/patchwork/files/wsgi.py b/per-service/patchwork/files/wsgi.py
deleted file mode 100644
index 05eab27e..00000000
--- a/per-service/patchwork/files/wsgi.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/python
-import os
-import sys
-
-basedir = os.path.dirname(__file__)
-sys.path.append(os.path.join(basedir, 'tools'))
-sys.path.append(os.path.join(basedir, 'project'))
-
-os.environ['DJANGO_SETTINGS_MODULE'] = 'local_settings'
-
-from django.core.wsgi import get_wsgi_application
-application = get_wsgi_application()
diff --git a/per-service/patchwork/group_vars/all b/per-service/patchwork/group_vars/all
deleted file mode 100644
index 1668705c..00000000
--- a/per-service/patchwork/group_vars/all
+++ /dev/null
@@ -1,17 +0,0 @@
-db_name: patchwork
-db_user: patchwork
-db_password: patchwork
-hostname: "{{inventory_hostname}}"
-apache_user: www-data
-apache_modules:
- - ssl
- - wsgi
- - rewrite
-django_project_repo: "https://github.com/getpatchwork/patchwork.git"
-django_project_version: 7591971245aa8d43b21f1f429a223fc0792f2274
-django_settings: local_settings
-django_local_settings: templates/{{inventory_hostname}}_local_settings.py
-install_base: /srv
-ssl_cert: /etc/ssl/certs/{{hostname}}.crt
-ssl_key: /etc/ssl/private/{{hostname}}.key
-ssl_ca_cert: /etc/ssl/certs/gd_bundle-g2-g1.crt
diff --git a/per-service/patchwork/hosts b/per-service/patchwork/hosts
deleted file mode 100644
index 5c983800..00000000
--- a/per-service/patchwork/hosts
+++ /dev/null
@@ -1,3 +0,0 @@
-[production]
-patches.opendataplane.org
-patches.linaro.org
diff --git a/per-service/patchwork/roles/apache-site b/per-service/patchwork/roles/apache-site
deleted file mode 120000
index 0e4340b9..00000000
--- a/per-service/patchwork/roles/apache-site
+++ /dev/null
@@ -1 +0,0 @@
-../../../roles/apache-site/ \ No newline at end of file
diff --git a/per-service/patchwork/roles/django b/per-service/patchwork/roles/django
deleted file mode 120000
index 655d5cd4..00000000
--- a/per-service/patchwork/roles/django
+++ /dev/null
@@ -1 +0,0 @@
-../../../roles/django \ No newline at end of file
diff --git a/per-service/patchwork/roles/patchwork-pre-django/tasks/main.yml b/per-service/patchwork/roles/patchwork-pre-django/tasks/main.yml
deleted file mode 100644
index a7333010..00000000
--- a/per-service/patchwork/roles/patchwork-pre-django/tasks/main.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-- name: Install apt dependencies
- apt: name={{item}} state=installed
- with_items:
- - python-dulwich
- - python-mock
- - python-pip
-
-- name: Create base directory for installation
- file: path={{install_base}}/{{hostname}}
- owner={{apache_user}} group={{apache_user}} mode=0755 state=directory
-
-- name: Create directory for git repos
- file: path="{{install_base}}/{{hostname}}/repos" state=directory
- owner={{apache_user}} group={{apache_user}}
-
-- name: Install patchwork tools
- git: repo=https://git.linaro.org/infrastructure/patchwork-tools.git
- dest={{install_base}}/{{hostname}}/tools
- update=yes accept_hostkey=true version="HEAD"
- become_user: "{{apache_user}}"
- tags:
- - update
-
-- name: Copy apache wsgi script
- copy: src=files/wsgi.py
- dest={{install_base}}/{{hostname}}/wsgi.py
- owner={{apache_user}} group={{apache_user}} mode=0755
- notify: restart-apache
- tags:
- - update
-
-- name: Install cron for patchwork
- template: src=templates/patchwork.cron.d dest=/etc/cron.d/patchwork
- owner=root group=root mode=0644
-
-- name: Clone django-crowd-rest-backend repository
- git: repo=http://git.linaro.org/lava/django-crowd-rest-backend.git
- dest=/srv/django-crowd-rest-backend version="HEAD"
- register: crowdbackend
-
-- name: Install django-crowd-rest-backed
- command: python ./setup.py install
- chdir=/srv/django-crowd-rest-backend
- when: crowdbackend is defined and crowdbackend.changed
diff --git a/per-service/patchwork/roles/postgres b/per-service/patchwork/roles/postgres
deleted file mode 120000
index 2ed7da57..00000000
--- a/per-service/patchwork/roles/postgres
+++ /dev/null
@@ -1 +0,0 @@
-../../../roles/postgres \ No newline at end of file
diff --git a/per-service/patchwork/secrets b/per-service/patchwork/secrets
deleted file mode 120000
index b3b56aa9..00000000
--- a/per-service/patchwork/secrets
+++ /dev/null
@@ -1 +0,0 @@
-../../../shared-credentials/ansible/patchwork-servers \ No newline at end of file
diff --git a/per-service/patchwork/site.yml b/per-service/patchwork/site.yml
deleted file mode 100644
index bca365da..00000000
--- a/per-service/patchwork/site.yml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-- name: Configure patchwork servers
- hosts: all
- become: yes
- vars_files:
- - "secrets/{{inventory_hostname}}"
- roles:
- - postgres
- - patchwork-pre-django
- - {role: django, tags: [django]}
- - {role: apache-site, src: apache.conf, config: "{{inventory_hostname}}", tags: [apache] }
-
-- name: Configure extra syncing for patches.linaro.org
- hosts: patches.linaro.org
- become: yes
- tasks:
- - template: src=templates/patches.cron.d dest=/etc/cron.d/patches
- owner=root group=root mode=0644
diff --git a/per-service/patchwork/templates/patches.cron.d b/per-service/patchwork/templates/patches.cron.d
deleted file mode 100644
index c740ea8e..00000000
--- a/per-service/patchwork/templates/patches.cron.d
+++ /dev/null
@@ -1,4 +0,0 @@
-MAILTO=linaro-infrastructure-errors@lists.linaro.org
-# sync gerrit once a day
-13 12 * * * www-data {{install_base}}/{{hostname}}/tools/linaro_metrics/sync_gerrit_changes.py
-3 3 * * * www-data {{install_base}}/{{hostname}}/tools/linaro_metrics/sync_teams.py
diff --git a/per-service/patchwork/templates/patches.linaro.org_local_settings.py b/per-service/patchwork/templates/patches.linaro.org_local_settings.py
deleted file mode 100644
index e30b6256..00000000
--- a/per-service/patchwork/templates/patches.linaro.org_local_settings.py
+++ /dev/null
@@ -1,66 +0,0 @@
-import os
-import sys
-
-sys.path.append(os.path.join(os.path.dirname(__file__), '../tools'))
-from linaro_metrics.settings import * # NOQA
-
-DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2',
- 'NAME': '{{db_name}}',
- 'USER': '{{db_user}}',
- 'PASSWORD': '{{db_password}}',
- 'HOST': 'localhost',
- },
- 'orig': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2',
- 'NAME': 'patchwork-orig',
- 'USER': '{{db_user}}',
- 'PASSWORD': '{{db_password}}',
- 'HOST': 'localhost',
- },
-}
-
-ALLOWED_HOSTS = [
- '*',
-]
-
-SECRET_KEY = '{{secret_key}}'
-
-TIME_ZONE = 'UTC'
-
-ADMINS = (
- ('linaro-infrastructure', 'linaro-infrastructure-errors@linaro.org'),
-)
-
-DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@{{hostname}}>'
-NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL
-
-STATIC_ROOT = '{{install_base}}/{{hostname}}/static'
-
-IMAP_SERVER = '{{imap_server}}'
-IMAP_USER = '{{imap_user}}'
-IMAP_PASS = '{{imap_pass}}'
-
-AUTHENTICATION_BACKENDS = (
- 'django.contrib.auth.backends.ModelBackend',
- 'crowdrest.backend.CrowdRestBackend',
-)
-
-CROWD_USER = '{{crowd_user}}'
-CROWD_PASS = '{{crowd_pass}}'
-CROWD_URL = '{{crowd_url}}'
-
-REPO_DIR = '{{install_base}}/{{hostname}}/repos'
-
-DEFAULT_PROJECTS = []
-
-AUTH_CROWD_ALWAYS_UPDATE_USER = False
-AUTH_CROWD_ALWAYS_UPDATE_GROUPS = False
-AUTH_CROWD_CREATE_GROUPS = False
-AUTH_CROWD_APPLICATION_USER = CROWD_USER
-AUTH_CROWD_APPLICATION_PASSWORD = CROWD_PASS
-AUTH_CROWD_SERVER_REST_URI = CROWD_URL
-AUTHENTICATION_BACKENDS = ('crowdrest.backend.CrowdRestBackend',)
-
-REPO_TIMEOUT = 240
diff --git a/per-service/patchwork/templates/patches.opendataplane.org_local_settings.py b/per-service/patchwork/templates/patches.opendataplane.org_local_settings.py
deleted file mode 100644
index 8a08ecfc..00000000
--- a/per-service/patchwork/templates/patches.opendataplane.org_local_settings.py
+++ /dev/null
@@ -1,54 +0,0 @@
-from patchwork.settings.base import * # NOQA
-
-DATABASES = {
- 'default': {
- 'ENGINE': 'django.db.backends.postgresql_psycopg2',
- 'NAME': '{{db_name}}',
- 'USER': '{{db_user}}',
- 'PASSWORD': '{{db_password}}',
- 'HOST': 'localhost',
- },
-}
-
-ALLOWED_HOSTS = [
- '*',
-]
-
-SECRET_KEY = '{{secret_key}}'
-
-TIME_ZONE = 'UTC'
-
-ADMINS = (
- ('Andy Doan', 'andy.doan@linaro.org'),
-)
-
-DEFAULT_FROM_EMAIL = 'Patchwork <patchwork@{{hostname}}>'
-NOTIFICATION_FROM_EMAIL = DEFAULT_FROM_EMAIL
-ENABLE_XMLRPC = True
-
-STATIC_ROOT = '{{install_base}}/{{hostname}}/static'
-
-IMAP_SERVER = '{{imap_server}}'
-IMAP_USER = '{{imap_user}}'
-IMAP_PASS = '{{imap_pass}}'
-
-REPO_DIR = '{{install_base}}/{{hostname}}/repos'
-
-DEFAULT_PROJECTS = [
- {
- 'linkname': 'lng-odp',
- 'name': 'LNG Open Dataplane',
- 'listid': 'lng-odp.lists.linaro.org',
- 'listemail': 'lng-odp@lists.linaro.org',
- 'scm_url': 'git://git.linaro.org/lng/odp.git',
- 'webscm_url': 'http://git.linaro.org/lng/odp.git/commit/',
- },
- {
- 'linkname': 'lng-odp-dpdk',
- 'name': 'LNG Open Dataplane DPDK',
- 'listid': 'lng-odp-dpdk.lists.linaro.org',
- 'listemail': 'lng-odp-dpdk@lists.linaro.org',
- 'scm_url': 'git://git.linaro.org/lng/odp-dpdk.git',
- 'webscm_url': 'http://git.linaro.org/lng/odp-dpdk.git/commit/',
- },
-]
diff --git a/per-service/patchwork/templates/patchwork.cron.d b/per-service/patchwork/templates/patchwork.cron.d
deleted file mode 100644
index 0e3c02ab..00000000
--- a/per-service/patchwork/templates/patchwork.cron.d
+++ /dev/null
@@ -1,5 +0,0 @@
-MAILTO=linaro-infrastructure-errors@lists.linaro.org
-# check patchwork email every 10 minutes
-*/10 * * * * www-data {{install_base}}/{{hostname}}/tools/import_emails.py
-# sync code every hour
-0 * * * * www-data {{install_base}}/{{hostname}}/tools/update_commited_patches.py