Skip to content

A simple project for demonstrating continuous delivery and docker

Notifications You must be signed in to change notification settings

MartinAhrer/continuousdelivery

Repository files navigation

Continuous Delivery Demo

INFO: This is work in progress. We will add features for demoing various aspects of DevOps.

TODO

  • Add unit test

  • Add Sonar (metrics)

  • Add build facade (gradle tasks for stages commit, integrationTest, userAcceptanceTest, production)

  • Add flyway data migration

  • Add containerized test with postgresql

Build

Docker

See src/main/docker/README.adoc

Jib

Build ARM64v8 image

Building a ARM64v8 image requires to manually trigger the pipeline and configure the task to be executed. First a arm64v8 base image is required. This is configured using the jib.from.image property. The built image needs a tag indicating that this is an image targeting the arm64v8 platform. This is configured using the jib.to.image property.

Build with overridden variable DELIVER_JOB_GRADLE_TASK_ARGS value

jib -Djib.from.image=arm64v8/openjdk:11-jre-slim -Djib.to.image="$CI_REGISTRY_IMAGE:arm64v8"

Native Image

sdk use java 22.3.r17-grl #(1)
gw nativeCompile #(2)
  1. Select GraalVM SDK (using sdkman)

  2. Compile to native image

Run

Run using docker compose
cd src/main/docker
docker compose up -d

Dependency Management

Dependency up-to-date check

./gradlew dependencyUpdates

Dependency vulnerability checking

Export a project dependency report using the cyclonedx Gradle plugin.

./gradlew cyclonedxBom

Start the dependencytrack server following their documentation. And then send the exported dependencies to the dependencytrack web API

curl -vv -X "POST" "http://localhost:8081/api/v1/bom" \
    -H 'Content-Type: multipart/form-data' \
    -H "X-Api-Key: egmBk6wqlfi3yT7vh88RCbfgo89pveyT" \ # (1)
    -F "autoCreate=true" \
    -F "projectName=continuousdelivery" \
    -F "projectVersion=0.1" \
    -F "bom=@build/reports/bom.json"
  1. Get API key from dependencytrack’s web user interface (e.g. Team Administrators)