Skip to content

Commit

Permalink
Merge pull request #140 from VictorArnaud/dev
Browse files Browse the repository at this point in the history
Finalizando a release 01
  • Loading branch information
VictorDeon authored Jul 15, 2018
2 parents 8821239 + 459d24f commit 1787fcc
Show file tree
Hide file tree
Showing 340 changed files with 10,410 additions and 7,588 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ env:

# Install docker dependencies
before_script:
- docker-compose up -d
- docker-compose -f docker-compose.test.yml up -d

# Script project dependencies
script:
- docker exec tbl-local coverage run --source="." pgtbl/manage.py test pgtbl/**/tests/
- docker exec tbl-local coverage report -m
- docker exec tbl-local coverage xml
- docker exec tbl-local python-codacy-coverage -r coverage.xml
- docker exec tbl-test coverage run --source="." pgtbl/manage.py test pgtbl
- docker exec tbl-test coverage report -m
- docker exec tbl-test coverage xml
- docker exec tbl-test python-codacy-coverage -r coverage.xml

deploy:
# deploy to staging enviroment
- provider: script
script: bash scripts/homolog-deploy.sh
skip_cleanup: true
on:
branch: develop
branch: dev

# deploy to production enviroment
- provider: script
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bcbcac621e1847e7af8e61bc202a03c6)](https://www.codacy.com/app/VictorArnaud/TBL?utm_source=github.com&utm_medium=referral&utm_content=TeamBasedLearning/TBL&utm_campaign=Badge_Grade)
[![Build Status](https://travis-ci.org/VictorArnaud/TBL.svg?branch=master)](https://travis-ci.org/VictorArnaud/TBL)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/bcbcac621e1847e7af8e61bc202a03c6)](https://www.codacy.com/app/VictorArnaud/TBL?utm_source=github.com&utm_medium=referral&utm_content=TeamBasedLearning/TBL&utm_campaign=Badge_Coverage)

# Documentação do PGTBL: Plataforma gerenciadora de Team Based Learning.

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
depends_on:
- tbl

# TBL app
# TBL production app
tbl:
image: victorhad/tbl:latest
container_name: tbl
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.homolog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'
# Homolog enviroment
services:
tbl-homolog:
image: victorhad/tbl:homolog
container_name: tbl-homolog
build:
context: .
dockerfile: ./images/homolog/Dockerfile
ports:
- "8000:8080"
8 changes: 0 additions & 8 deletions docker-compose.local.yml

This file was deleted.

13 changes: 13 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3'
# Test enviroment
services:
tbl-test:
image: victorhad/tbl:test
container_name: tbl-test
build:
context: .
dockerfile: ./images/homolog/Dockerfile
environment:
- CODACY_PROJECT_TOKEN=2856565478ce4400a4cd4731950bfb89
ports:
- "8000:8080"
10 changes: 6 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
version: '3'
# Development enviroment
services:
tbl-local:
image: victorhad/tbl:local
container_name: tbl-local
environment:
- CODACY_PROJECT_TOKEN=2856565478ce4400a4cd4731950bfb89
build:
context: .
dockerfile: ./images/local/Dockerfile
volumes:
- .:/software
- .:/home/developer/
ports:
- "8080:8080"
- "8000:8080"
34 changes: 34 additions & 0 deletions images/homolog/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Build an debian image
FROM python:3.6

# Update, Upgrade and configure locale
RUN apt-get update

# Install SO dependecies
RUN apt-get install -y python3-dev \
python3-pip \
libpq-dev \
gettext \
vim \
build-essential

# Install pip dependecies
COPY pgtbl/requirements.txt /requirements/local.txt
RUN pip3 install --upgrade pip
RUN pip3 install -r /requirements/local.txt

ADD . /software
WORKDIR /software

# Insert Enviroment variable
ENV MODE_ENVIROMENT=development

# Run the dev script before and after any command
RUN chmod +x images/homolog/homolog.sh
ENTRYPOINT ["images/homolog/homolog.sh"]

# Expose 8000 port
EXPOSE 8080

# Run the server
CMD ["python3", "pgtbl/manage.py", "runserver", "0.0.0.0:8080"]
12 changes: 12 additions & 0 deletions images/homolog/homolog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
#
# Purpose: Config homolog enviroment
#
# Author: Victor Arnaud <victorhad@gmail.com>

echo "Creating migrations and insert into sqlite database"
make migrations
make migrate

echo "Run the server"
make run
12 changes: 12 additions & 0 deletions makefiles/django.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ compilemessages:
staticfiles: pgtbl/manage.py
# Collect all static files
python3 pgtbl/manage.py collectstatic --noinput

# POPULATE DB --------------------------------------------------

json := database.json

fixture: pgtbl/manage.py
# Create files with data
python3 pgtbl/manage.py dumpdata ${model} --indent 4 > ${json}

populate: pgtbl/manage.py
# Populate database with specific model
python3 pgtbl/manage.py loaddata pgtbl/**/fixtures/**.json
4 changes: 2 additions & 2 deletions makefiles/test.mk
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# TESTS --------------------------------------------------------
tests_folder := pgtbl/**/tests/
folder := pgtbl

test: coverage report xml

coverage:
# Execute all tests
coverage run --source="." pgtbl/manage.py test ${tests_folder}
coverage run --source="." pgtbl/manage.py test ${folder}

report:
# Show coverage on terminal
Expand Down
4 changes: 0 additions & 4 deletions pgtbl/TBLSessions/admin.py

This file was deleted.

5 changes: 0 additions & 5 deletions pgtbl/TBLSessions/apps.py

This file was deleted.

65 changes: 0 additions & 65 deletions pgtbl/TBLSessions/urls.py

This file was deleted.

Loading

0 comments on commit 1787fcc

Please sign in to comment.