...
 
Commits (2)
......@@ -122,7 +122,9 @@ build:
- docker tag registry.gitlab.com/failmap/admin:build registry.gitlab.com/failmap/admin:$(cat version|tr + _)
- docker push registry.gitlab.com/failmap/admin:$(cat version|tr + _)
only: [master]
only:
- master
- tags
retry: 1
test_build:
......@@ -207,5 +209,6 @@ production:
# insert deploy magic here
only: [tags]
only:
- tags
retry: 1
......@@ -60,6 +60,11 @@
<li><span style="margin-top:10px;" class='btn btn-danger btn-sm btn-block'>DEBUG</span></li>
</ul>
{% endif %}
{% if admin %}
<ul class="nav navbar-nav pull-right">
<li><a href="{% url 'admin:index' %}">{% trans "Admin" %}</a></li>
</ul>
{% endif %}
</div><!--/.nav-collapse -->
</div>
</nav>
......
......@@ -4,6 +4,7 @@ from datetime import datetime, timedelta
import pytz
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.db import connection
from django.db.models import Count
from django.http import JsonResponse
......@@ -33,6 +34,7 @@ def index(request):
return render(request, 'map/index.html', {
'version': get_distribution(__name__.split('.', 1)[0]).version,
'admin': settings.ADMIN,
})
......
......@@ -464,3 +464,6 @@ if DEBUG:
except ImportError:
# send statsd metrics to logging
STATSD_CLIENT = 'django_statsd.clients.log'
# is administrative backend enabled on this instance
ADMIN = bool(APPNAME == 'failmap-admin')
......@@ -33,7 +33,8 @@ frontend_urls = [
urlpatterns = frontend_urls.copy()
if settings.APPNAME == 'failmap-admin':
# enable admin url's if this is an administrative (more secured/read-write) instance
if settings.ADMIN:
urlpatterns += admin_urls
if settings.DEBUG:
......