Python packaging support
Can be installed from a local checkout with `pip install -e .` or directly from git: `pip install -e git+git@github.com:arachnys/cabot.git#egg=cabot`
2
.gitignore
vendored
@ -5,6 +5,8 @@ backups/*
|
|||||||
static/CACHE/*
|
static/CACHE/*
|
||||||
node_modules/*
|
node_modules/*
|
||||||
.python-eggs/*
|
.python-eggs/*
|
||||||
|
cabot.egg-info
|
||||||
|
cabot/.env
|
||||||
.DS_Store
|
.DS_Store
|
||||||
celerybeat-schedule.db
|
celerybeat-schedule.db
|
||||||
*.pyc
|
*.pyc
|
||||||
|
2
app/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*.pyc
|
|
||||||
*.DS_Store
|
|
@ -5,7 +5,7 @@ from polymorphic import PolymorphicModel
|
|||||||
from django.db.models import F
|
from django.db.models import F
|
||||||
from django.contrib.admin.models import User
|
from django.contrib.admin.models import User
|
||||||
|
|
||||||
from jenkins import get_job_status
|
from .jenkins import get_job_status
|
||||||
from .alert import send_alert
|
from .alert import send_alert
|
||||||
from .calendar import get_events
|
from .calendar import get_events
|
||||||
from .graphite import parse_metric
|
from .graphite import parse_metric
|
@ -12,11 +12,6 @@ from celery.task import task
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
|
|
||||||
# Add the root to the python path
|
|
||||||
root = os.path.abspath(os.path.join(settings.PROJECT_ROOT, '../'))
|
|
||||||
sys.path.append(root)
|
|
||||||
|
|
||||||
celery = Celery(__name__)
|
celery = Celery(__name__)
|
||||||
celery.config_from_object(settings)
|
celery.config_from_object(settings)
|
||||||
|
|
@ -6,7 +6,7 @@ from django.core.urlresolvers import reverse
|
|||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.test.client import Client
|
from django.test.client import Client
|
||||||
from cabotapp.models import (
|
from cabot.cabotapp.models import (
|
||||||
GraphiteStatusCheck, JenkinsStatusCheck,
|
GraphiteStatusCheck, JenkinsStatusCheck,
|
||||||
HttpStatusCheck, Service, StatusCheckResult)
|
HttpStatusCheck, Service, StatusCheckResult)
|
||||||
from cabotapp.views import StatusCheckReportForm
|
from cabotapp.views import StatusCheckReportForm
|
@ -4,10 +4,10 @@ from dateutil.relativedelta import relativedelta
|
|||||||
from django.http import HttpResponse, HttpResponseRedirect
|
from django.http import HttpResponse, HttpResponseRedirect
|
||||||
from django.core.urlresolvers import reverse_lazy
|
from django.core.urlresolvers import reverse_lazy
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from models import (
|
from .models import (
|
||||||
StatusCheck, GraphiteStatusCheck, JenkinsStatusCheck, HttpStatusCheck,
|
StatusCheck, GraphiteStatusCheck, JenkinsStatusCheck, HttpStatusCheck,
|
||||||
StatusCheckResult, UserProfile, Service, Shift, get_duty_officers)
|
StatusCheckResult, UserProfile, Service, Shift, get_duty_officers)
|
||||||
from tasks import run_status_check as _run_status_check
|
from .tasks import run_status_check as _run_status_check
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
from django.views.generic import (
|
from django.views.generic import (
|
@ -2,18 +2,18 @@ import os
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
BROKER_URL = os.environ['CELERY_BROKER_URL']
|
BROKER_URL = os.environ['CELERY_BROKER_URL']
|
||||||
CELERY_IMPORTS = ('app.cabotapp.tasks', )
|
CELERY_IMPORTS = ('cabot.cabotapp.tasks', )
|
||||||
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
|
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
|
||||||
CELERY_TASK_SERIALIZER = "json"
|
CELERY_TASK_SERIALIZER = "json"
|
||||||
CELERY_ACCEPT_CONTENT = ['json', 'msgpack', 'yaml']
|
CELERY_ACCEPT_CONTENT = ['json', 'msgpack', 'yaml']
|
||||||
|
|
||||||
CELERYBEAT_SCHEDULE = {
|
CELERYBEAT_SCHEDULE = {
|
||||||
'run-all-checks': {
|
'run-all-checks': {
|
||||||
'task': 'app.cabotapp.tasks.run_all_checks',
|
'task': 'cabot.cabotapp.tasks.run_all_checks',
|
||||||
'schedule': timedelta(seconds=60),
|
'schedule': timedelta(seconds=60),
|
||||||
},
|
},
|
||||||
'update-shifts': {
|
'update-shifts': {
|
||||||
'task': 'app.cabotapp.tasks.update_shifts',
|
'task': 'cabot.cabotapp.tasks.update_shifts',
|
||||||
'schedule': timedelta(seconds=1800),
|
'schedule': timedelta(seconds=1800),
|
||||||
},
|
},
|
||||||
}
|
}
|
@ -1,9 +1,10 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cabot.settings")
|
||||||
|
|
||||||
from django.core.management import execute_from_command_line
|
from django.core.management import execute_from_command_line
|
||||||
|
|
@ -2,7 +2,7 @@ import os
|
|||||||
import dj_database_url
|
import dj_database_url
|
||||||
|
|
||||||
settings_dir = os.path.dirname(__file__)
|
settings_dir = os.path.dirname(__file__)
|
||||||
PROJECT_ROOT = os.path.abspath(os.path.dirname(settings_dir))
|
PROJECT_ROOT = os.path.abspath(settings_dir)
|
||||||
|
|
||||||
TEMPLATE_DEBUG = DEBUG = os.environ.get("DEBUG", False)
|
TEMPLATE_DEBUG = DEBUG = os.environ.get("DEBUG", False)
|
||||||
|
|
||||||
@ -93,10 +93,10 @@ MIDDLEWARE_CLASSES = (
|
|||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
'django.contrib.messages.middleware.MessageMiddleware',
|
||||||
)
|
)
|
||||||
|
|
||||||
ROOT_URLCONF = 'app.urls'
|
ROOT_URLCONF = 'cabot.urls'
|
||||||
|
|
||||||
TEMPLATE_DIRS = (
|
TEMPLATE_DIRS = (
|
||||||
os.path.join(PROJECT_ROOT, 'app/templates/'),
|
os.path.join(PROJECT_ROOT, 'templates'),
|
||||||
)
|
)
|
||||||
|
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
@ -116,7 +116,7 @@ INSTALLED_APPS = (
|
|||||||
'djcelery',
|
'djcelery',
|
||||||
'mptt',
|
'mptt',
|
||||||
'jsonify',
|
'jsonify',
|
||||||
'app.cabotapp',
|
'cabot.cabotapp',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -207,5 +207,5 @@ LOGGING = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
from celeryconfig import *
|
from cabot.celeryconfig import *
|
||||||
from cabot_config import *
|
from cabot.cabot_config import *
|
7382
cabot/static/CACHE/css/8015660a5d18.css
Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 646 B After Width: | Height: | Size: 646 B |
Before Width: | Height: | Size: 872 B After Width: | Height: | Size: 872 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 312 B |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 313 B After Width: | Height: | Size: 313 B |
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 559 B After Width: | Height: | Size: 559 B |
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 494 B After Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 324 B |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 78 B After Width: | Height: | Size: 78 B |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 101 B After Width: | Height: | Size: 101 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 68 B |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 180 B After Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 178 B |
Before Width: | Height: | Size: 120 B After Width: | Height: | Size: 120 B |
Before Width: | Height: | Size: 105 B After Width: | Height: | Size: 105 B |
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
Before Width: | Height: | Size: 110 B After Width: | Height: | Size: 110 B |
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 119 B |