Building
./mvnw compile
Test
./mvnw test
Start the application
./mvnw spring-boot:run
- CREATE A NEW ORDER.
http://localhost:8080/books_stock/makeOrder
BODY:
{
"userOrder" : [
{
"id": "14e05a52-eec7-4ff4-af1b-d6fd1cb90207", -- id of the book i want to buy
"name": "irure aute aliquip occaecat anim", -- name of book
"quantity": 2 -- quantity of books i want to buy
}
]
}
Id of the order: 1.810001012623587E9
- GET ALL THE ORDERS.
http://localhost:8080/books_stock/orders
[
{
"id": "1.829429931559126E9", -- id of the request
"status": "SUCCESFUL", -- status of the request
"orderDate": "2022-04-13T22:28:55.471125",
"bookStocks": [ -- book that i have bought
{
"id": "14e05a52-eec7-4ff4-af1b-d6fd1cb90207",
"name": "irure aute aliquip occaecat anim",
"quantity": 1 -- current stock of the book
}
]
},
{
"id": "1.810001012623587E9",
"status": "CANCELLED",
"orderDate": "2022-04-13T22:29:02.660066",
"bookStocks": [
{
"id": "14e05a52-eec7-4ff4-af1b-d6fd1cb90207",
"name": "irure aute aliquip occaecat anim",
"quantity": 1
}
]
}
]
Add this 2 lines in /etc/hosts file:
127.0.0.1 api.oursaas.org
127.0.0.1 static.oursaas.org
./docker compose up -d
api.oursaas.org:4565
api.oursaas.org:4231
static.oursaas.org:4566
- Install locally Jenkins: https://www.jenkins.io/doc/pipeline/tour/getting-started/
- Create pipeline: 2.1 New Item 2.2 Pipeline 2.3 Pipeline -> Definition -> Pipeline script from SCM 2.4 SCM -> Git 2.5 Repository URL -> https://github.com/frannciscolopez/bookStore 2.6 Apply
- Go to the pipeline.
- Build now.