Lab 1 Report
-
The pipeline that succesfully runs the game with my logic service is linked to this commit: Commit 6d15e57e - CI: add pipeline for build, image generation and game execution .
-
.gitlab-ci.yml structure:
- Build: Compiles the Java code using Maven via ./mvnw .
- Package: Builds a container image using Quarkus Jib. I use the 25-jdk base image for building and 25-jre for runtime. The imgae is automatically pushed to the Gilab Container Registry.
- Execute: Launches the game using the devops-runner image. My logic service is added as a Docker service and the game communicates with it via http://logic-service:8080.
- Lab questions:
-
What is ./mvnw and why is it useful? ./mvnw is the Maven Wrapper. It ensures that everyone uses the same Maven version without requiring a local installation. This makes builds more consistent and simplifies CI/CD.
-
Difference between Gitlab cache and artifacts, and my choice. Cache: shared between jobs and can be reused in future pipelines. Artifacts: files explicitly stored after a job and made availabe to subsequent jobs in the same pipeline. I use cache for Maven dependencies and artifacts for build files like JARs.
-
Why use 25-jre for runtime and 25-jdk for builds? What if I switch them? 25-jdk includes tools needed for building (like javac), while 25-jre is sufficient to run the application. If I switch them, the build might fail due to missing tools, or the runtime image would be unnecessarily large.