For using Github Codespaces, no prerequisites are mandatory. Follow the ./PREREQUISITES.md instructions to configure a local virtual machine with Ubuntu, Docker, IntelliJ.
.. adding a new secret line .
- Fork the code GitHub repository under your Organization
- Clone the code repository:
- git@github.com:YOUR_ORG_NAME/service.git
- Make sure that the Github repository is forked under your account / Organization
- Create a new Codespace from your forked repository
- Wait for the Codespace to be up and running
- Make sure that Docker service has been started
docker psshould return no error
- For running / debugging directly in Visual Studio Code
- Start the MongoDB related services
./start_mongo_only.sh
- Build and run the Spring Boot service
./gradlew build./gradlew bootRun
- Start the MongoDB related services
- For running all services in Docker:
- Build the Docker image of the prod-eng service
make build
- Start all the service containers
./start.sh
- Build the Docker image of the prod-eng service
- Use requests.http to test API endpoints
- Navigation between methods (e.g. 'Go to Definition') may require:
./gradlew build
NOTE: for a live demo, please check out this youtube video
- Build the code
- IntelliJ will build it automatically
- If you want to build it from command line and also run unit tests, run:
./gradlew build
- Create an IntelliJ run configuration for a Jar application
- Add in the configuration the JAR path to the build folder
./build/libs/prod-eng-0.0.1-SNAPSHOT.jar
- Add in the configuration the JAR path to the build folder
- Start the MongoDB container using Docker Compose
./start_mongo_only.sh
- Run/debug your IntelliJ run configuration
- Open in your browser:
-
Build the Docker image of the prod-eng service
make build
-
Start all the containers
./start.sh
-
Verify that all containers started, by running
service git:(master) ✗ $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d0a14d57ade1 jenkins/jenkins "/usr/bin/tini -- /u…" 5 seconds ago Up 4 seconds 0.0.0.0:50000->50000/tcp, [::]:50000->50000/tcp, 0.0.0.0:8082->8080/tcp, [::]:8082->8080/tcp service-jenkins-1 d9465565ebc9 mongo-express "/sbin/tini -- /dock…" 5 seconds ago Up 4 seconds 0.0.0.0:8090->8081/tcp, [::]:8090->8081/tcp service-mongo-admin-ui-1 304c29bb39ea mongo:6.0.20 "docker-entrypoint.s…" 5 seconds ago Up 4 seconds 0.0.0.0:27017->27017/tcp, [::]:27017->27017/tcp service-mongo-1 a74b4cb2fb58 prod-eng-img "java -jar /prod-eng…" 5 seconds ago Up 4 seconds 0.0.0.0:5005->5005/tcp, [::]:5005->5005/tcp, 0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp service-prod-eng-1 -
Open in your browser:
-
You can test other API endpoints using requests.http
-
You can access the MongoDB Admin UI at:
- http://localhost:8090
- default credentials: username
unibuc, passwordadobe - database
testcontains application entities