Fix docker, tasks, change js's to min and add static files to project

parent 077ddad5
---
engines:
csslint:
enabled: true
enabled: false
duplication:
enabled: true
config:
......@@ -11,15 +11,13 @@ engines:
enabled: true
radon:
enabled: true
config:
threshold: 'B'
ratings:
paths:
- "**.css"
- "**.inc"
- "**.js"
- "**.jsx"
- "**.module"
- "**.php"
- "src/smi_unb/report/static/js/**.js"
- "src/smi_unb/users/static/js/**.js"
- "src/smi_unb/**/static/**/css/**.css"
- "**.py"
- "**.rb"
exclude_paths:
- "src/**/tests.py"
\ No newline at end of file
- "src/**/tests/test_**.py"
\ No newline at end of file
# Cached builds
__pycache__/
*.pyc
*.pyo
*.pyd
*.so
*.dll
*.egg
*.sqlite3
*.egg-info/
.sass-cache/
.coverage
# Non-required directories and files
backup/
log/
.cache/
.idea/
.git/
.gitignore
.travis.yml
# Build directories
build/
dist/
# Database
db/
# Static files
node_modules/
# Sources and documentation
static_src/
artwork/
docs/
......@@ -27,7 +27,6 @@ build/
dist/
node_modules/
docs/_build/
docker/nginx/collect/static/*
docker/env
htmlcov/
......
......@@ -3,16 +3,6 @@ O que é?
O Sistema de Monitoramento de Insumos - Universidade de Brasília (SMI-UnB), consiste em uma aplicação web desenvolvida para auxiliar o monitoramento dos insumos importantes para a Universidade de Brasília. A ideia visa que cada Campus contido na UnB possa ser capaz de utilizar a ferramenta e ter um maior conhecimento de como está o consumo de seus insumos importantes ao longo do tempo, possibilitando, assim, elaborar possíveis estratégias que auxiliem em sua economia.
Principais Funcionalidades
--------
- Geração de relatórios
- Gráficos de consumo, demanda e afins
- Monitoramento temporal de transdutores
- Simulação de fatura
- Sistema de alarme para eventos indesejados
Características Técnicas
--------
......@@ -20,10 +10,10 @@ Características Técnicas
- Linguagem de programação: Python3
- Web Framework: Django
Documentação
--------
TODO
Instalação
--------
https://gitlab.com/brenddongontijo/SMI-UnB/wikis/instalation-guide
Documentação
--------
https://gitlab.com/brenddongontijo/SMI-UnB/wikis/home
\ No newline at end of file
0 * * * * export $(cat /root/env | xargs) && python3 /app/manage.py runcrons smi_unb.api.cronjob.MeasurementsSyncCronJob
# Necessary line at end of file to make cron valid
\ No newline at end of file
* * * * * export $(cat /root/env | xargs) && python3 /app/manage.py runcrons smi_unb.data_reader.cronjob.DataCollectCronJob
# Empty endline to make this cron valid.
# Necessary line at end of file to make cron valid
\ No newline at end of file
version: '2'
services:
nginx:
restart: always
build: ./docker/nginx/
ports:
- "80:80"
volumes:
- ./docker/nginx/collect/static/:/var/www/static/
volumes_from:
- web
links:
- web:web
web:
build:
context: .
dockerfile: ./docker/Dockerfile.master
expose:
- "8000"
links:
- postgres:postgres
- redis:redis
env_file: ./docker/env
volumes:
- ./src/:/app/src/
postgres:
restart: always
image: postgres:latest
volumes_from:
- data
volumes:
- ./docker/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
env_file:
- ./docker/env
expose:
- "5432"
redis:
restart: always
image: redis:latest
expose:
- "6379"
data:
restart: always
image: alpine
volumes:
- /var/lib/postgresql
command: "true"
......@@ -13,7 +13,9 @@ services:
- web:web
web:
build: .
build:
context: .
dockerfile: ./docker/Dockerfile.slave
expose:
- "8000"
links:
......
......@@ -5,7 +5,7 @@ RUN apt-get update &&\
\
# Extra deps
cron \
python3-pip
python3-pip
# Base deps
RUN pip3 install \
......@@ -45,13 +45,8 @@ COPY src/ /app/src/
ENV PYTHONPATH=src \
SMI_UNB_PRODUCTION=true
ADD scripts/start.sh /bin/start.sh
# Collecting Static Files
RUN python3 manage.py collectstatic --noinput
# Setting cron
ADD crontab /etc/cron.d/smi-cron
ADD crons/master_cron /etc/cron.d/smi-cron
RUN chmod 0644 /etc/cron.d/smi-cron
......@@ -59,4 +54,7 @@ RUN touch /var/log/cron.log
RUN /usr/bin/crontab /etc/cron.d/smi-cron
CMD /bin/bash /bin/start.sh
# Initializing container with script
ADD scripts/start.sh /bin/start.sh
CMD /bin/bash /bin/start.sh
\ No newline at end of file
......@@ -37,7 +37,6 @@ COPY [ \
"boilerplate.ini", \
"manage.py", \
"tasks.py", \
"temp_cron", \
"/app/" \
]
......@@ -46,7 +45,16 @@ COPY src/ /app/src/
ENV PYTHONPATH=src \
SMI_UNB_PRODUCTION=true
# Setting crontab
RUN crontab temp_cron && rm temp_cron
RUN crontab -l
RUN crontab -r
\ No newline at end of file
# Setting cron
ADD crons/slave_cron /etc/cron.d/smi-cron
RUN chmod 0644 /etc/cron.d/smi-cron
RUN touch /var/log/cron.log
RUN /usr/bin/crontab /etc/cron.d/smi-cron
# Initializing container with script
ADD scripts/start.sh /bin/start.sh
CMD /bin/bash /bin/start.sh
\ No newline at end of file
This diff is collapsed.
/* CHANGELISTS */
#changelist {
position: relative;
width: 100%;
}
#changelist table {
width: 100%;
}
.change-list .hiddenfields { display:none; }
.change-list .filtered table {
border-right: none;
}
.change-list .filtered {
min-height: 400px;
}
.change-list .filtered .results, .change-list .filtered .paginator,
.filtered #toolbar, .filtered div.xfull {
margin-right: 280px;
width: auto;
}
.change-list .filtered table tbody th {
padding-right: 1em;
}
#changelist-form .results {
overflow-x: auto;
}
#changelist .toplinks {
border-bottom: 1px solid #ddd;
}
#changelist .paginator {
color: #666;
border-bottom: 1px solid #eee;
background: #fff;
overflow: hidden;
}
/* CHANGELIST TABLES */
#changelist table thead th {
padding: 0;
white-space: nowrap;
vertical-align: middle;
}
#changelist table thead th.action-checkbox-column {
width: 1.5em;
text-align: center;
}
#changelist table tbody td.action-checkbox {
text-align: center;
}
#changelist table tfoot {
color: #666;
}
/* TOOLBAR */
#changelist #toolbar {
padding: 8px 10px;
margin-bottom: 15px;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
background: #f8f8f8;
color: #666;
}
#changelist #toolbar form input {
border-radius: 4px;
font-size: 14px;
padding: 5px;
color: #333;
}
#changelist #toolbar form #searchbar {
height: 19px;
border: 1px solid #ccc;
padding: 2px 5px;
margin: 0;
vertical-align: top;
font-size: 13px;
}
#changelist #toolbar form #searchbar:focus {
border-color: #999;
}
#changelist #toolbar form input[type="submit"] {
border: 1px solid #ccc;
padding: 2px 10px;
margin: 0;
vertical-align: middle;
background: #fff;
box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset;
cursor: pointer;
color: #333;
}
#changelist #toolbar form input[type="submit"]:focus,
#changelist #toolbar form input[type="submit"]:hover {
border-color: #999;
}
#changelist #changelist-search img {
vertical-align: middle;
margin-right: 4px;
}
/* FILTER COLUMN */
#changelist-filter {
position: absolute;
top: 0;
right: 0;
z-index: 1000;
width: 240px;
background: #f8f8f8;
border-left: none;
margin: 0;
}
#changelist-filter h2 {
font-size: 14px;
text-transform: uppercase;
letter-spacing: 0.5px;
padding: 5px 15px;
margin-bottom: 12px;
border-bottom: none;
}
#changelist-filter h3 {
font-weight: 400;
font-size: 14px;
padding: 0 15px;
margin-bottom: 10px;
}
#changelist-filter ul {
margin: 5px 0;
padding: 0 15px 15px;
border-bottom: 1px solid #eaeaea;
}
#changelist-filter ul:last-child {
border-bottom: none;
padding-bottom: none;
}
#changelist-filter li {
list-style-type: none;
margin-left: 0;
padding-left: 0;
}
#changelist-filter a {
display: block;
color: #999;
}
#changelist-filter li.selected {
border-left: 5px solid #eaeaea;
padding-left: 10px;
margin-left: -15px;
}
#changelist-filter li.selected a {
color: #5b80b2;
}
#changelist-filter a:focus, #changelist-filter a:hover,
#changelist-filter li.selected a:focus,
#changelist-filter li.selected a:hover {
color: #036;
}
/* DATE DRILLDOWN */
.change-list ul.toplinks {
display: block;
float: left;
padding: 0;
margin: 0;
width: 100%;
}
.change-list ul.toplinks li {
padding: 3px 6px;
font-weight: bold;
list-style-type: none;
display: inline-block;
}
.change-list ul.toplinks .date-back a {
color: #999;
}
.change-list ul.toplinks .date-back a:focus,
.change-list ul.toplinks .date-back a:hover {
color: #036;
}
/* PAGINATOR */
.paginator {
font-size: 13px;
padding-top: 10px;
padding-bottom: 10px;
line-height: 22px;
margin: 0;
border-top: 1px solid #ddd;
}
.paginator a:link, .paginator a:visited {
padding: 2px 6px;
background: #79aec8;
text-decoration: none;
color: #fff;
}
.paginator a.showall {
padding: 0;
border: none;
background: none;
color: #5b80b2;
}
.paginator a.showall:focus, .paginator a.showall:hover {
background: none;
color: #036;
}
.paginator .end {
margin-right: 6px;
}
.paginator .this-page {
padding: 2px 6px;
font-weight: bold;
font-size: 13px;
vertical-align: top;
}
.paginator a:focus, .paginator a:hover {
color: white;
background: #036;
}
/* ACTIONS */
.filtered .actions {
margin-right: 280px;
border-right: none;
}
#changelist table input {
margin: 0;
vertical-align: baseline;
}
#changelist table tbody tr.selected {
background-color: #FFFFCC;
}
#changelist .actions {
padding: 10px;
background: #fff;
border-top: none;
border-bottom: none;
line-height: 24px;
color: #999;
}
#changelist .actions.selected {
background: #fffccf;
border-top: 1px solid #fffee8;
border-bottom: 1px solid #edecd6;
}
#changelist .actions span.all,
#changelist .actions span.action-counter,
#changelist .actions span.clear,
#changelist .actions span.question {
font-size: 13px;
margin: 0 0.5em;
display: none;
}
#changelist .actions:last-child {
border-bottom: none;
}
#changelist .actions select {
vertical-align: top;
height: 24px;
background: none;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 14px;
padding: 0 0 0 4px;
margin: 0;
margin-left: 10px;
}
#changelist .actions select:focus {
border-color: #999;
}
#changelist .actions label {
display: inline-block;
vertical-align: middle;
font-size: 13px;
}
#changelist .actions .button {
font-size: 13px;
border: 1px solid #ccc;
border-radius: 4px;
background: #fff;
box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset;
cursor: pointer;
height: 24px;
line-height: 1;
padding: 4px 8px;
margin: 0;
color: #333;
}
#changelist .actions .button:focus, #changelist .actions .button:hover {
border-color: #999;
}
/* DASHBOARD */
.dashboard .module table th {
width: 100%;
}
.dashboard .module table td {
white-space: nowrap;
}
.dashboard .module table td a {
display: block;
padding-right: .6em;
}
/* RECENT ACTIONS MODULE */
.module ul.actionlist {
margin-left: 0;
}
ul.actionlist li {
list-style-type: none;
}
ul.actionlist li {
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
@font-face {
font-family: 'Roboto';
src: url('../fonts/Roboto-Bold-webfont.woff');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('../fonts/Roboto-Regular-webfont.woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Roboto'