forked from rAlvaPrincipe/ews_events
-
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
Showing
2 changed files
with
47 additions
and
20 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 |
---|---|---|
@@ -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. | ||
|
||
|
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