This repository has been archived by the owner on Oct 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Dulce-Work-Schedule/3_4_5_7_Inicial
- Loading branch information
Showing
24 changed files
with
257 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,20 @@ | ||
sudo: required | ||
language: node_js | ||
services: | ||
- docker | ||
node_js: | ||
- "8" | ||
cache: | ||
directories: | ||
- "node_modules" | ||
script: | ||
- npm install -g | ||
- npm run lint | ||
matrix: | ||
include: | ||
- language: node_js | ||
os: linux | ||
install: | ||
|
||
before_install: | ||
- sudo apt-get remove docker docker-engine docker.io | ||
- sudo apt-get update | ||
- sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | ||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
- sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose | ||
- sudo chmod +x /usr/local/bin/docker-compose | ||
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | ||
- sudo apt-get update | ||
- sudo apt-get install docker-ce | ||
- docker-compose version | ||
- docker version | ||
|
||
before_script: | ||
- cd $TRAVIS_BUILD_DIR/Database | ||
- sudo docker-compose up --build -d& | ||
- cd $TRAVIS_BUILD_DIR/RabbitMQ | ||
- sudo docker-compose up --build -d& | ||
- cd $TRAVIS_BUILD_DIR/User | ||
- sudo docker-compose up --build -d& | ||
- cd $TRAVIS_BUILD_DIR/Login | ||
- sudo docker-compose up --build -d& | ||
env: | ||
- DOCKER_COMPOSE_VERSION=1.21.0 | ||
services: | ||
- docker | ||
|
||
env: | ||
- DOCKER_COMPOSE_VERSION=1.21.0 | ||
before_install: | ||
- sudo curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose | ||
- sudo chmod +x /usr/local/bin/docker-compose | ||
- docker-compose version | ||
- docker version | ||
before_script: | ||
- ./utils/script_coveralls.sh | ||
- cd $TRAVIS_BUILD_DIR/Docker/Test | ||
- sudo docker-compose -f build.yml build | ||
|
||
script: | ||
- cd $TRAVIS_BUILD_DIR/Login | ||
- sudo docker-compose run loginserver npm run test | ||
script: | ||
- sudo docker-compose -f start-sector.yml run sectorserver npm run coverage |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM dulce/dulce:base-dev | ||
|
||
COPY Client/package.json /usr/src/app/package.json | ||
|
||
RUN npm install --development | ||
|
||
ADD Client/ /usr/src/app | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM dulce/dulce:base-dev | ||
|
||
COPY Server/package.json /usr/src/app/package.json | ||
|
||
RUN npm install --development | ||
|
||
ADD Server/ /usr/src/app | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: '3.5' | ||
|
||
services: | ||
sectorserver: | ||
image: dulce/sector-server:dev | ||
build: | ||
context: ../../ | ||
dockerfile: Docker/Dev/Server/Dockerfile | ||
|
||
sectorclient: | ||
image: dulce/sector-client:dev | ||
build: | ||
context: ../../ | ||
dockerfile: Docker/Dev/Client/Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MONGO_DATABASE=dataBaseSectors | ||
MONGO_HOST=sectormongo | ||
MONGO_PORT=27017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
RABBITMQ_DEFAULT_USER=dulce | ||
RABBITMQ_DEFAULT_PASS=dulce | ||
|
||
RABBITMQ_HOST=sectorrabbitmq | ||
RABBITMQ_PORT=5672 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: '3.5' | ||
|
||
services: | ||
sectormongo: | ||
image: mongo | ||
env_file: | ||
- ./env/mongo.env | ||
networks: | ||
- dulce-db | ||
ports: | ||
- 27017 | ||
volumes: | ||
- db_data:/data/db | ||
|
||
sectorrabbitmq: | ||
image: rabbitmq:3.6.14-management | ||
env_file: | ||
- ./env/rabbitmq.env | ||
ports: | ||
- 5672:5672 | ||
- 15672:15672 | ||
networks: | ||
- dulce-rabbitmq | ||
|
||
networks: | ||
dulce-db: | ||
name: dulce-db | ||
dulce-rabbitmq: | ||
name: dulce-rabbitmq | ||
|
||
volumes: | ||
db_data: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
version: '3.5' | ||
|
||
services: | ||
sectorserver: | ||
image: dulce/sector-server:dev | ||
restart: always | ||
env_file: | ||
- ./env/mongo.env | ||
- ./env/rabbitmq.env | ||
ports: | ||
- 8080:8080 | ||
volumes: | ||
- ../../Server:/usr/src/app | ||
- /usr/src/app/node_modules | ||
networks: | ||
- dulce-db | ||
- dulce-rabbitmq | ||
|
||
sectorclient: | ||
image: dulce/sector-client:dev | ||
restart: always | ||
env_file: | ||
- ./env/rabbitmq.env | ||
ports: | ||
- 8083:8080 | ||
volumes: | ||
- ../../Client:/usr/src/app | ||
- /usr/src/app/node_modules | ||
networks: | ||
- dulce-rabbitmq | ||
|
||
networks: | ||
dulce-db: | ||
name: dulce-db | ||
dulce-rabbitmq: | ||
name: dulce-rabbitmq |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM dulce/dulce:base-dev | ||
|
||
COPY Client/package.json /usr/src/app/package.json | ||
|
||
RUN npm i -g npm | ||
RUN npm install --development | ||
ADD Client/ /usr/src/app/ | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["npm","start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM dulce/dulce:base-dev | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ADD Server/package.json /usr/src/app/ | ||
|
||
RUN npm install | ||
|
||
ADD Server /usr/src/app | ||
|
||
CMD ["npm", "run", "coverage"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: '3.5' | ||
|
||
services: | ||
sectorserver: | ||
image: dulce/sector-server:test | ||
build: | ||
context: ../../ | ||
dockerfile: Docker/Test/Server/Dockerfile | ||
|
||
sectorclient: | ||
image: dulce/sector-client:test | ||
build: | ||
context: ../../ | ||
dockerfile: Docker/Test/Client/Dockerfile |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.5' | ||
|
||
services: | ||
sectorserver: | ||
image: dulce/sector-server:test | ||
restart: always | ||
env_file: | ||
- ./env/coveralls.env | ||
ports: | ||
- 8080:8080 | ||
volumes: | ||
- ../../Server:/usr/src/app | ||
- /usr/src/app/node_modules |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module.exports = function(options){ | ||
|
||
this.add('role:sector,cmd:create', function create (msg,respond) { | ||
var sector = this.make('sectors') | ||
sector.name = msg.name | ||
sector.save$(function(err,sector){ | ||
respond(null,sector) | ||
}) | ||
}) | ||
|
||
this.add('role:sector, cmd:listSector', function listSector(msg, respond){ | ||
var sector = this.make('sectors'); | ||
sector.list$({all$:true}, function(error,sector){ | ||
respond(null,sector); | ||
}); | ||
}) | ||
|
||
this.add('role:sector, cmd:error', function error(msg, respond){ | ||
respond(null, {success:false, message: 'acesso negado'}); | ||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,17 @@ | ||
require('seneca')() | ||
.use("entity") | ||
.use('mongo-store',{ | ||
name:'dataBaseHospitals', | ||
host:'mongo', | ||
port:27017 | ||
name: process.env.MONGO_DATABASE, | ||
host:process.env.MONGO_HOST, | ||
port: process.env.MONGO_PORT | ||
}) | ||
.use('seneca-amqp-transport') | ||
.use('_sector') | ||
.listen({ | ||
type:'amqp', | ||
pin:'role:sector', | ||
port: 5672, | ||
username: 'guest', | ||
password: 'guest', | ||
url: 'amqp://rabbitmq', | ||
port: process.env.RABBITMQ_PORT, | ||
username: process.env.RABBITMQ_DEFAULT_USER, | ||
password: process.env.RABBITMQ_DEFAULT_PASS, | ||
url: 'amqp://'+ process.env.RABBITMQ_HOST | ||
}) | ||
|
||
.add('role:sector,cmd:create', function create (msg,respond) { | ||
var sector = this.make('sectors') | ||
sector.name = msg.name | ||
sector.save$(function(err,sector){ | ||
respond(null,sector) | ||
}) | ||
}) | ||
|
||
.add('role:sector, cmd:listSector', function listSector(msg, respond){ | ||
var sector = this.make('sectors'); | ||
sector.list$({all$:true}, function(error,sector){ | ||
respond(null,sector); | ||
}); | ||
}) | ||
|
||
.add('role:sector, cmd:error', function error(msg, respond){ | ||
respond(null, {success:false, message: 'acesso negado'}); | ||
}) |
Oops, something went wrong.