A Java Spring Boot microservice to handlle creation of user accounts.
- Requires Java LTS 21 or greater.
# update version when needed
./gradlew wrapper --gradle-version 8.14.2
./gradlew -q javaToolchains
- This steps assumes you are using
JetBrains IntelliJIDEA
- SonarQube Plugin Installation
# remove all containers
docker container rm -vf $(docker ps -aq)
docker image rm -f $(docker images -aq)
docker system prune -a --volumes
# clean the build
./gradlew clean -i
# lint and unit tests
./gradlew check -i
# create a layered bootjar
./gradlew bootJar -i
# build and push bootjar to dockerhub
# TODO fix in next releases
./gradlew bootBuildImage -i
# only Rubens can release
./gradlew release -i
-
Start docker container:
cd app docker compose up --detach --no-recreate --remove-orphans || { printf "failed to stop container.\n" >&2 sleep 5 }
-
Stop docker container:
cd app docker compose down --remove-orphans || { printf "failed to stop container.\n" >&2 sleep 5 }
-
To render the
Hello World!
messasge:curl --verbose "http://localhost:8080/api/v1/helloworld"
# start bootjar
./gradlew bootRun -i
# stop running bootjar
./gradlew --stop
# render the Hello World! message:
curl --verbose "http://localhost:8080/api/createuseraccount"
- Ensure cluster is set up
- Ensure task definition is set up (SERVER_PORT=8888)
- Ensure service is up and running
- Ensure security group allows proper inbound traffic to port 8888
- http://<ECS-TASK-PUBLIC_IP>:8888/api/v1/createuseraccount
Author: Rubens Gomes