Skip to content

Commit

Permalink
Merge pull request #24 from fga-eps-mds/develop
Browse files Browse the repository at this point in the history
Sprint 10
  • Loading branch information
WillAllmeida authored Nov 14, 2019
2 parents f8c0d9a + 73c8ec1 commit 560e268
Show file tree
Hide file tree
Showing 70 changed files with 2,560 additions and 711 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# dependencies
/node_modules

package-lock.json
# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json
Expand Down
14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@ sudo: required
services:
- docker

env:
- DOCKER_COMPOSE_VERSION=1.24.1

install:
- echo "RUN npm install coveralls" >> Dockerfile
- echo "ENV REPO_TOKEN ${COVERALLS_REPO_TOKEN}" >> Dockerfile
- echo "ENV TRAVIS_BRANCH ${TRAVIS_BRANCH}" >> Dockerfile
- echo "ENV TRAVIS_JOB_ID ${TRAVIS_JOB_ID}" >> Dockerfile
- echo "ENV CI ${CI}" >> Dockerfile
- echo "ENV TRAVIS ${TRAVIS}" >> Dockerfile
- docker-compose up --build -d

script:
- docker exec -it foodcare-web ng test --watch=false
- docker exec -it foodcare-web ng test --watch=false --code-coverage

after_script:
- docker-compose down
- docker exec -it foodcare-web sh -c "cat ./coverage/foodcare/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
- docker-compose down --remove-orphans
19 changes: 7 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
# Use an official node runtime as a parent image
FROM node:12

RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list
RUN apt-get update && apt-get install --no-install-recommends -y google-chrome-stable
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && apt-get install -yq google-chrome-stable

WORKDIR /app/foodcare-web
WORKDIR /foodcare-web

ENV PATH /app/foodcare-web/node_modules/.bin:$PATH
ENV PATH /foodcare-web/node_modules/.bin:$PATH

# Install dependencies
COPY package.json /app/foodcare-web/package.json
RUN npm install -g @angular/cli
COPY package.json /foodcare-web/
RUN npm install -g npm
RUN npm install


COPY . /app/foodcare-web

EXPOSE 4200

CMD ng serve --host 0.0.0.0 --port 4200
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<a href="https://www.gnu.org/licenses/gpl-3.0" alt="Licença: GPL v3" >
<img src="https://img.shields.io/badge/License-GPLv3-blue.svg" />
</a>
<a href='https://coveralls.io/github/fga-eps-mds/2019.2-FoodCare-WebApp?branch=master'><img src='https://coveralls.io/repos/github/fga-eps-mds/2019.2-FoodCare-WebApp/badge.svg?branch=master' alt='Coverage Status' /></a>
</p>

<p align="center">
Expand Down Expand Up @@ -69,6 +70,15 @@ Para subir a aplicação no endereço `0.0.0.0` e na porta 4200 utilize o seguin

A aplicação estará disponível em `http://localhost:4200`.

## Ambientes

### Homologação

`https://foodcarehomol.netlify.com/`

### Produção

`https://foodcare.netlify.com/`
<!-- ## Testes
Descreva e mostre como rodar testes. -->
Expand Down
32 changes: 31 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,35 @@
"maximumError": "10kb"
}
]
},
"homol": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.homol.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
Expand Down Expand Up @@ -94,7 +123,8 @@
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.css"
],
"scripts": []
"scripts": [],
"codeCoverage": true
}
},
"lint": {
Expand Down
14 changes: 8 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
version: "3.0"
version: "3.1"
services:
foodcare-web:
container_name: foodcare-web
build: ./
volumes:
- './:/app/foodcare-web'
- '/app/foodcare-web/node_modules'
restart: always
image: frontend:latest
build: .
ports:
- "4200:4200"
command: bash -c "npm install && ng serve --host 0.0.0.0 --port 4200"
volumes:
- .:/foodcare-web
- /foodcare-web/node_modules
command: ng serve --host 0 --port 4200
29 changes: 29 additions & 0 deletions ngsw-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/manifest.webmanifest",
"/*.css",
"/*.js"
]
}
}, {
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
]
}
}
]
}
Loading

0 comments on commit 560e268

Please sign in to comment.