= Task EDU Samples

This is the foundation project from which Spring Cloud Data Flow's Task Edu materials will be derived.

== Overview
This project contains 2 apps:

* *billsetuptask* - is a Spring Cloud Task app that will create the table required for the billrun application.
* *billrun* - is a Spring Cloud Task/Spring Batch app that will read JSON files containing simple user cellphone usage data from a specified directory, price it and place the results in another table.

== Build the project
From the root project execute the following:
```
$ ./mvnw clean package
```

== Build the project zip file
```
$./mvnw clean package -Pdist
```

== Build the Docker Images for the project
```
$ ./mvnw spring-boot:build-image
```

NOTE: You can modify the docker org and version by applying the following: `-Ddocker.org=<your org> -Ddocker.version=<your version>`

== Executing the jars

=== To execute billsetuptask locally

Assuming you are using Mariadb
```
$ java -jar target/billsetuptask-2.0.0-SNAPSHOT.jar --spring.datasource.url=jdbc:mariadb://localhost:3306/<your database>?useSSL=false --spring.datasource.username=<user> --spring.datasource.password=<password> --spring.datasource.driverClassName=org.mariadb.jdbc.Driver
```

=== To execute billrun locally

Assuming you are using Mariadb, this app will load data from the usageinfo.txt file found in the classpath (included in the jar).
```
$ java -jar target/billrun-2.0.0-SNAPSHOT.jar --spring.datasource.url=--spring.datasource.url=jdbc:mariadb://localhost:3306/<your database>?useSSL=false --spring.datasource.username=<user> --spring.datasource.password=<password> --spring.datasource.driverClassName=org.mariadb.jdbc.Driver
```
If you wish to read a directory containing the data you can use the following command line argument:
`--usage.file.name=file://<location of json file to upload>`


