Stable Packaging: mvn clean package
Stable Packaging without tests: mvn clean package -DskipTests
Native Packaging: mvn clean package -Pnative
Docker Build: docker build -f src/main/docker/Dockerfile.jvm -t binocla/textgenerator .
Docker Run: docker run -i --rm --env PORT=8080 -p 8080:8080 binocla/textgenerator
- Build Image with "mvn clean package -DskipTests" for example
- Build Docker Image: docker build -f src/main/docker/Dockerfile.jvm -t textgenerator .
- Login to Heroku by: heroku login
- Create Cluster if needed: heroku create textgenerator --region eu
- Login to container hub: heroku container:login
- Tag Image for better code reading: docker tag textgenerator:latest registry.heroku.com/binoclatextgenerator/web
- Push Image to Heroku: docker push registry.heroku.com/binoclatextgenerator/web
- Release Image: heroku container:release web -a <app_name>
- To Upload File send POST request to the server (test via Postman or cURL)
example: curl -F "file=@/home/binocla/Documents/qwe.txt" https://binoclatextgenerator.herokuapp.com/upload/file
where "file=@/home/binocla..." is full path to the file (with its extension). The last one is address of the server
The response might be "All files name of the file successfully" - To Get the generated text of the Uploaded file (default: len:10, depth:1) use:
curl -X POST -H "Content-Type: text/plain" --data "qwe.txt" https://binoclatextgenerator.herokuapp.com/api
where --data "name of the file"
To Get the generated text of the Uploaded file (with properties) use:
curl -X POST -H "Content-Type: text/plain" --data "qwe.txt 100 3" https://binoclatextgenerator.herokuapp.com/api/param
where --data "name of the file len depth"