-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
André Luis Gomes
committed
Jun 19, 2019
1 parent
628b159
commit 263e1df
Showing
16 changed files
with
260 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Challenge | ||
|
||
## Requirements | ||
|
||
```text | ||
$ docker version | ||
Client: | ||
Version: 18.06.0-ce | ||
``` | ||
|
||
## Running | ||
|
||
```bash | ||
$ docker-compose up | ||
``` | ||
|
||
## Links | ||
+ https://www.base64decode.org/ | ||
+ https://www.freeformatter.com/xml-formatter.html | ||
+ https://docs.arquivei.com.br/?urls.primaryName=Arquivei%20API#/ | ||
|
||
+ https://www.stitchdata.com/etldatabase/etl-extract/ | ||
+ https://docs.oracle.com/cd/B19306_01/server.102/b14223/ettover.htm | ||
|
||
+ https://cloud.docker.com/repository/docker/andrelugomes/etl-invoice | ||
+ https://cloud.docker.com/repository/docker/andrelugomes/api-invoice |
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,8 @@ | ||
FROM zenika/kotlin:1.2.71-jdk8-alpine | ||
|
||
MAINTAINER [email protected] | ||
|
||
ADD build/libs/api-*.jar /api.jar | ||
|
||
ENTRYPOINT exec java -jar api.jar | ||
|
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,42 @@ | ||
# Invoices API | ||
|
||
+ kotlin | ||
+ MySQL | ||
|
||
|
||
## MySQL | ||
|
||
```bash | ||
docker run --name mysql_invoices -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=invoices -p 3306:3306 -d mysql | ||
``` | ||
|
||
## Build API | ||
|
||
```bash | ||
cd api-invoice | ||
|
||
./gradlew clean build | ||
``` | ||
|
||
```bash | ||
docker build -t andrelugomes/api-invoice . | ||
``` | ||
|
||
## Release API | ||
|
||
```bash | ||
docker login --username=andrelugomes | ||
|
||
docker push andrelugomes/api-invoice:latest | ||
``` | ||
## Run API | ||
|
||
```bash | ||
docker run -d --name api-invoice --net host andrelugomes/api-invoice:latest | ||
``` | ||
|
||
http://localhost:8081/swagger-ui.html | ||
|
||
|
||
|
||
|
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 @@ | ||
server.port=8081 | ||
|
||
spring.datasource.url=jdbc:mysql://mysql:3306/invoices | ||
spring.datasource.username=root | ||
spring.datasource.password=root |
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,26 @@ | ||
version: '3' | ||
|
||
services: | ||
api: | ||
image: "andrelugomes/api-invoice:latest" | ||
ports: | ||
- "8081:8081" | ||
environment: | ||
SPRING_PROFILES_ACTIVE: docker | ||
depends_on: | ||
- mysql | ||
|
||
etl: | ||
image: "andrelugomes/etl-invoice:latest" | ||
environment: | ||
SPRING_PROFILES_ACTIVE: docker | ||
depends_on: | ||
- mysql | ||
|
||
mysql: | ||
image: mysql | ||
ports: | ||
- "3307:3306" | ||
environment: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: invoices |
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,7 @@ | ||
FROM openjdk:11.0.3 | ||
|
||
MAINTAINER [email protected] | ||
|
||
ADD build/libs/etl-invoice-*.jar /etl.jar | ||
|
||
ENTRYPOINT exec java -jar etl.jar |
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,41 @@ | ||
# ETL Invoices | ||
|
||
+ java 11 | ||
+ MySQL | ||
|
||
|
||
## MySQL | ||
|
||
```bash | ||
docker run --name mysql_invoices -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=invoices -p 3306:3306 -d mysql | ||
``` | ||
|
||
## Build ETL | ||
|
||
```bash | ||
cd etl-invoice | ||
|
||
./gradlew clean build | ||
``` | ||
|
||
```bash | ||
docker build -t andrelugomes/etl-invoice . | ||
``` | ||
|
||
## Release ETL | ||
|
||
```bash | ||
docker login --username=andrelugomes | ||
|
||
docker push andrelugomes/etl-invoice:latest | ||
``` | ||
|
||
## Run ETL | ||
|
||
```bash | ||
docker run -it --net host andrelugomes/etl-invoice:latest | ||
``` | ||
|
||
|
||
|
||
|
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
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
20 changes: 20 additions & 0 deletions
20
etl-invoice/src/main/java/br/com/arquivei/etl/invoice/domain/invoice/xml/InfProt.java
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,20 @@ | ||
package br.com.arquivei.etl.invoice.domain.invoice.xml; | ||
|
||
import javax.xml.bind.annotation.XmlElement; | ||
|
||
public class InfProt { | ||
|
||
public InfProt() { | ||
} | ||
|
||
private String chNFe; | ||
|
||
@XmlElement(name = "chNFe") | ||
public String getChNFe() { | ||
return chNFe; | ||
} | ||
|
||
public void setChNFe(final String chNFe) { | ||
this.chNFe = chNFe; | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
etl-invoice/src/main/java/br/com/arquivei/etl/invoice/domain/invoice/xml/ProtNFe.java
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,20 @@ | ||
package br.com.arquivei.etl.invoice.domain.invoice.xml; | ||
|
||
import javax.xml.bind.annotation.XmlElement; | ||
|
||
public class ProtNFe { | ||
|
||
public ProtNFe() { | ||
} | ||
|
||
private InfProt infProt; | ||
|
||
@XmlElement(name = "infProt") | ||
public InfProt getInfProt() { | ||
return infProt; | ||
} | ||
|
||
public void setInfProt(final InfProt infProt) { | ||
this.infProt = infProt; | ||
} | ||
} |
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,4 @@ | ||
spring.datasource.url=jdbc:mysql://mysql:3306/invoices?createDatabaseIfNotExist=true | ||
spring.datasource.username=root | ||
spring.datasource.password=root | ||
|
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