Skip to content

Commit

Permalink
- README.md updated
Browse files Browse the repository at this point in the history
  • Loading branch information
miciav committed Dec 13, 2019
1 parent 46e854d commit 06aba35
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 20 deletions.
65 changes: 47 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,63 @@
## Configure
On application.properties you can configure your DB and API endpoint.
## Configuration
The behavior of the application can be configured in different ways. One way is to provide a *application.properties* configuration file.
On application.properties you can configure the DB and API endpoint.
For example:

```
#ArangoDB
spring.data.arangodb.hosts=localhost:8529
spring.data.arangodb.database=events
spring.data.arangodb.user=root
spring.data.arangodb.password=openSesame
#configure the application not to use ArangoDB uncomment the following line
#spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.ArangoAutoConfiguration
#API events
API=https://virtserver.swaggerhub.com/EW-Shopp/EW-Shopp_Event_API/2.2.0/event/
#number of days to retrieve
num_days=5
starting_date=2018-01-01
ending_date=2018-02-01
working_path=work
results_dir=events
outputOnFile=enabled #to enable the application to generate an output file
fileName = output.json #output file name
```

## Build using Apache Maven
```
$ mvn package
```
# Webapp port
server.port = 8080

# Arango DB
arango.host=localhost
arango.port=8529
arango.user=root
arango.password=root
arango.database=_system
## Build with Docker
Once the application is packaged a docker container can be created automatically using maven with following command

#API events
API = https://virtserver.swaggerhub.com/EW-Shopp/EW-Shopp_Event_API/2.2.0/event/
```
$ mvn docker:build
```
and pushed

## Build
```
$ mvn package
$ mvn docker:push
```
The user and container name can be configured in the *pom.xml* file.


## Run
```
$ java -jar target/EventsEWSArango-0.0.1-SNAPSHOT.jar date N
$ java -jar target/EventsEWSArango-0.1.jar --spring.config.location=file:///${properties_file}
```
"date" is in iso 8601 format and it's default is the current date. "N" is the information on the number of days (0 < N <= 99) making up the time interval within which the events to be obtained have begun.
"date" is mandatory if there is "N".
"N" is optional.


## Run with Docker Compose
A courtesy docker-compose.yml file is provided in src/main/docker. The application can be
executed with the following command:

```
$ docker-compose up -d
```
Docker compose will take care of downloading the container from the Docker Hub and executing it against a mock custom event server.


2 changes: 0 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Webapp port
server.port=8080
#ArangoDB
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.ArangoAutoConfiguration
spring.data.arangodb.hosts=localhost:8529
Expand Down

0 comments on commit 06aba35

Please sign in to comment.