Skip to content

Commit

Permalink
[MERGE] Sprint 11
Browse files Browse the repository at this point in the history
Sprint 11
  • Loading branch information
andre-filho committed May 29, 2018
2 parents 912c982 + b724510 commit 142f66d
Show file tree
Hide file tree
Showing 32 changed files with 1,822 additions and 188 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
"env": {
"browser": true,
"node": true
"node": true,
"jquery": true
},
"extends": ["eslint:recommended", "plugin:vue/recommended"],

Expand Down
38 changes: 15 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
sudo: required
group: deprecated-2017Q3

services:
- docker
- docker
language: node_js
node_js:
- 9.11.1
- 9.11.1
env:
global:
- CC_TEST_REPORTER_ID=f9a7cc51d41f847d9b5c91f469606222755355ec9ea001c6bd7a16d20f45941f
before_script:
- npm install coveralls
- docker-compose -f docker-compose.test.yml up -d
- npm install coveralls
- docker-compose -f docker-compose.test.yml up -d
script:
- docker exec -it tropical-hazards-front npm test
- docker exec -it tropical-hazards-front npm test
after_script:
- "./node_modules/coveralls/bin/coveralls.js < ./test/unit/coverage/lcov.info"
- docker-compose down --remove-orphans
- "./node_modules/coveralls/bin/coveralls.js < ./test/unit/coverage/lcov.info"
- docker-compose down --remove-orphans
after_success:
- docker login --username=_ --password=$HEROKU_AUTHTOKEN registry.heroku.com
- docker build -f Dockerfile.prod -t deploy_image .
- |
if [ "${TRAVIS_BRANCH}" == "development" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
echo "Deploying to homolog environment..."
docker tag deploy_image registry.heroku.com/tropical-hazards-homolog/web
docker push registry.heroku.com/tropical-hazards-homolog/web
else if [ "${TRAVIS_BRANCH}" == "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
echo "Deploying to production environment..."
docker tag deploy_image registry.heroku.com/tropical-hazards/web
docker push registry.heroku.com/tropical-hazards/web
else
echo "Skipping deploy...";
fi;
fi;
- ./semantic-release.sh
deploy:
provider: script
script: bash travis-deploy.sh
skip_cleanup: true
on:
branch: development
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
FROM node:slim

RUN apt-get update
# RUN curl -sL https://deb.nodesource.com/setup_7.x | bash - && apt-get install -y nodejs tree libfontconfig bzip2 xvfb libgtk2.0-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 && npm install --quiet --global vue-cli
RUN apt-get update && apt-get install bzip2

WORKDIR /TropicalHazards-BI-FrontEnd
RUN mkdir -p /usr/src/tropical-hazards-frontend

COPY . /TropicalHazards-BI-FrontEnd
WORKDIR /usr/src/tropical-hazards-frontend

COPY package.json /package.json
COPY package.json /usr/src/tropical-hazards-frontend/

# RUN npm install
RUN npm install

COPY . /usr/src/tropical-hazards-frontend

EXPOSE 8080

RUN chmod +x start.sh

CMD ["./start.sh"]
9 changes: 0 additions & 9 deletions Dockerfile.dev

This file was deleted.

17 changes: 8 additions & 9 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ FROM node:slim

RUN apt-get update && apt-get install bzip2

COPY package.json /tmp/package.json
RUN cd /tmp && npm install
RUN mkdir -p /usr/src/TropicalHazards-BI-FrontEnd && \
cp -a /tmp/node_modules /usr/src/TropicalHazards-BI-FrontEnd
WORKDIR /usr/src/tropical-hazards-frontend

WORKDIR /usr/src/TropicalHazards-BI-FrontEnd
COPY package.json /usr/src/tropical-hazards-frontend/

COPY . /usr/src/TropicalHazards-BI-FrontEnd
RUN npm install

COPY . /usr/src/tropical-hazards-frontend

RUN npm run build

RUN rm -rf ./test ./src
RUN rm -rf ./src ./build ./test

EXPOSE 8080

RUN chmod +x start-prod.sh
RUN chmod +x start.sh

CMD ["./start-prod.sh"]
CMD ["./start.sh"]
9 changes: 0 additions & 9 deletions Dockerfile.test

This file was deleted.

40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
# tropical-hazards-bi-front-end
# Tropical Hazards BI

> front-end for Tropical Hazards BI
![](https://i.imgur.com/OhSvJLM.jpg)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a715ea21d0564479880d48f3eadd21af)](https://app.codacy.com/app/andre-filho/2018.1-TropicalHazards-BI-FrontEnd?utm_source=github.com&utm_medium=referral&utm_content=fga-gpp-mds/2018.1-TropicalHazards-BI-FrontEnd&utm_campaign=badger)
[![Build Status](https://travis-ci.org/fga-gpp-mds/2018.1-TropicalHazards-BI-FrontEnd.svg?branch=master)](https://travis-ci.org/fga-gpp-mds/2018.1-TropicalHazards-BI-FrontEnd)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Build Setup

## Sobre

<p align="justify"> O Tropical Hazards Business Intelligence é um sistema cujo a finalidade é auxiliar os pesquisadores e profissionais de saúde do Núcleo de Medicina Tropical da UnB, permitindo o gerenciamento e compartilhamento de dados e indicadores referentes às doenças tropicais. O sistema foi projetado de modo a permitir que os profissionais possam fazer análises estatísticas, compartilhar informações gerenciadas em dashboards e disponibilizar esses dados para o público.</p>

## Deploy
[Homolog](http://159.65.190.38)

## Documentação

Se você quiser saber como utilizar o sistema ou como o mesmo foi projetado, a [documentação](https://github.com/fga-gpp-mds/2018.1-TropicalHazards-BI/tree/master/docs) do projeto pode ser encontrada no link em destaque ou pode ser acessada através do [github pages](https://fga-gpp-mds.github.io/2018.1-TropicalHazards-BI) do projeto. Para contribuir com o projeto solicitamos que acesse o nosso workflow de repositório com a [política de branches](https://fga-gpp-mds.github.io/2018.1-TropicalHazards-BI/workflow/politica_de_branches), [política de commits](https://fga-gpp-mds.github.io/2018.1-TropicalHazards-BI/workflow/politica_de_commit) e [issue workflow](https://fga-gpp-mds.github.io/2018.1-TropicalHazards-BI/workflow/issue_workflow).

## Repositórios
Foram criados dois repositórios para o desenvolvimento do sistema, divididos em [back-end](https://github.com/fga-gpp-mds/2018.1-TropicalHazards-BI) e [front-end](https://github.com/fga-gpp-mds/2018.1-TropicalHazards-BI-FrontEnd). No segundo repositório estão as dependências e configurações para o ambiente de desenvolvimento com vue.js . O repositório atual é dedicado ao back-end, assim como a documentação do sistema.

## Instalação

#### 1- Garanta que os seguintes programas ja estão instalados em seu computador
[docker](https://docs.docker.com/install/) e [docker-compose](https://docs.docker.com/compose/install/#install-compose)
Expand All @@ -11,21 +29,11 @@
``` bash
$ docker network ls
```
#### 2.1 - Caso o _network_ "20181tropicalhazardsbi_default" não apareça nessa lista siga o tutorial para instalar o [back-end](https://github.com/fga-gpp-mds/2018.1-TropicalHazards-BI)
##### 2.1 - Caso o _network_ "20181tropicalhazardsbi_default" não apareça nessa lista siga o tutorial para instalar o [back-end](https://github.com/fga-gpp-mds/2018.1-TropicalHazards-BI)

#### 3 - Rode o npm install dentro do container utilizando o comando:
``` bash
$ docker-compose up
```
##### 3.1 - Derrube o serviço precionando "ctrl+c"

#### 4 - Altere a linha 211 do arquivo "node_modules/webpack-dev-server/bin/webpack-dev-server.js" para:
``` bash
default: '0.0.0.0',
```
#### 5 - Suba o serviço usando o comando:
#### 3 - Suba o serviço usando o comando:
``` bash
$ docker-compose up
```

#### 6 - O seu serviço estara rodando em "http://localhost:8080"
#### 4 - O seu serviço estara rodando em "http://localhost:8080"
4 changes: 3 additions & 1 deletion config/dev.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ const merge = require('webpack-merge')
const prodEnv = require('./prod.env')

module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
NODE_ENV: '"development"',
HOST: '"localhost"',
API_HOST: '"http://localhost:8000"',
})
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
proxyTable: {},

// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
host: process.env.HOST, // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
Expand Down
4 changes: 3 additions & 1 deletion config/prod.env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* eslint-disable */
'use strict'
module.exports = {
NODE_ENV: '"production"'
NODE_ENV: '"production"',
HOST: '"http://159.65.190.38"',
API_HOST: '"http://159.65.190.38/api"'
}
16 changes: 0 additions & 16 deletions docker-compose.dev.yml

This file was deleted.

13 changes: 7 additions & 6 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ version: '2'
services:
th_bi-front:
container_name: tropical-hazards-front
build:
dockerfile: Dockerfile.test
context: .
command: /bin/bash -lc "npm install && npm run dev"
build: .
command: /bin/bash start.sh
volumes:
- .:/TropicalHazards-BI-FrontEnd
external_links:
- 20181tropicalhazardsbi_default
ports:
- 8080:8080
- "8080:8080"
environment:
- NODE_ENV=test
networks:
- default

8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ version: '2'
services:
th_bi-front:
container_name: tropical-hazards-front
image: arthur0496/tropical-hazards-front:dev
command: /bin/bash -lc "npm install && npm run dev"
build: .
command: /bin/bash start.sh
volumes:
- .:/TropicalHazards-BI-FrontEnd
- .:/usr/src/tropical-hazards-frontend
external_links:
- 20181tropicalhazardsbi_default
ports:
- "8080:8080"
environment:
- NODE_ENV=development
networks:
- default
- 20181tropicalhazardsbi_default
Expand Down
Loading

0 comments on commit 142f66d

Please sign in to comment.