Lab 1 Report
Lab 1 report
Link to a successful run of the CI/CD job that executed the game
Structure report
CI/CD Pipeline Structure
The .gitlab-ci.yml defines three stages and three corresponding jobs:
-
Build Stage —
maven-build
Compiles the project source code and prepares it for packaging.
Maven dependencies are cached to speed up future builds. -
Package Stage —
maven-container-image-generation
Uses the build artifacts from the previous stage to create and push a Docker image to the GitLab registry. -
Execute Stage —
run-game
Runs and validates the built application inside a simulated game environment using the provideddevops-runnerimage.
##Answers to the questions
What is ./mvnw and why use it instead of mvn?
./mvnw is the Maven Wrapper, which ensures the correct Maven version is automatically used.
It guarantees consistent builds across environments, even if Maven isn’t installed locally, unlike mvn, which depends on the system version.
Cache vs Artifacts in GitLab
- Cache: Reuses files between jobs and pipelines (e.g., Maven dependencies).
- Artifacts: Passes build outputs between stages in the same pipeline.
Maven dependencies: cached — they rarely change and speed up subsequent runs.
Build files: stored as artifacts — needed only within the same pipeline for packaging and deployment.
Trade-offs:
Caches persist longer but can become outdated; artifacts are reliable and version-specific but take time to upload and download.
Why use 25-jdk for build and 25-jre for runtime?
The 25-jdk image includes the compiler and tools required to build the application.
The 25-jre image is smaller and contains only what’s needed to run the compiled app, improving performance and security.
Using 25-jdk for both increases size and exposure, while using 25-jre for both would fail to build the app.