From 17584028f566263ddcbccd828ea2baf5d141b59f Mon Sep 17 00:00:00 2001 From: "piotr.suwala" Date: Wed, 17 Apr 2024 18:29:13 +0200 Subject: [PATCH 1/5] none: added full example --- src/test/resources/full-example.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/test/resources/full-example.yaml diff --git a/src/test/resources/full-example.yaml b/src/test/resources/full-example.yaml new file mode 100644 index 0000000..5c9d515 --- /dev/null +++ b/src/test/resources/full-example.yaml @@ -0,0 +1,27 @@ +nodes: + - title: Tech Tree + state: done + - title: Outline + state: broken + - title: Onboarding + state: todo + requires: + - Tech Tree + - Outline + - title: Proces Listy Zakupowej + state: progress + requires: + - Tech Tree + - Outline + - title: Kubernetes + state: broken + - title: FluxCD + state: broken + requires: + - Kubernetes + - title: Syncronium + state: broken + link: http://example.com + docs: https://github.com/hspsh/syncronium + requires: + - FluxCD \ No newline at end of file From 81767856d6bfa045022a889675ca2d11f2d93df7 Mon Sep 17 00:00:00 2001 From: "piotr.suwala" Date: Wed, 17 Apr 2024 18:46:24 +0200 Subject: [PATCH 2/5] issue-10: Dockerfile --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ee6817a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM gradle:7-jdk17 AS build +COPY --chown=gradle:gradle . /home/gradle/src +WORKDIR /home/gradle/src +RUN gradle bootJar --no-daemon + +FROM openjdk:17 +RUN mkdir /app +COPY --from=build /home/gradle/src/build/libs/*.jar /app/app.jar +ENTRYPOINT ["java","-jar","/app/app.jar"] From 918933ac9804dc17925ecc9787bcca1a07fbd9e3 Mon Sep 17 00:00:00 2001 From: "piotr.suwala" Date: Wed, 17 Apr 2024 18:47:53 +0200 Subject: [PATCH 3/5] issue-11: Build and push to registry --- .github/workflows/docker.yml | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..39d403c --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,38 @@ +name: Create and publish a Docker image +on: [push] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 4794a4e064bcb3193a2b8b48586a280ec33abe9b Mon Sep 17 00:00:00 2001 From: "piotr.suwala" Date: Wed, 17 Apr 2024 19:37:32 +0200 Subject: [PATCH 4/5] issue: generate tree --- .github/workflows/generate-tree.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/generate-tree.yaml diff --git a/.github/workflows/generate-tree.yaml b/.github/workflows/generate-tree.yaml new file mode 100644 index 0000000..e57fb3f --- /dev/null +++ b/.github/workflows/generate-tree.yaml @@ -0,0 +1,12 @@ +name: Generate Tech Tree +on: [push] +jobs: + generate-tech-tree: + runs-on: ubuntu-latest + container: ghcr.io/hspsh/tech-tree:issue-10-dockerfile + steps: + - java -jar /app/app.jar ./src/test/resources/full-example.yaml > tree.svg + - cat tree.svg + test-files: + script: + - find . From 377363c3aeb7c0b45dc1b8a0f6b96e9765803fe6 Mon Sep 17 00:00:00 2001 From: "piotr.suwala" Date: Wed, 17 Apr 2024 20:24:58 +0200 Subject: [PATCH 5/5] issue-10 rebuilt --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ee6817a..787b8d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,8 @@ COPY --chown=gradle:gradle . /home/gradle/src WORKDIR /home/gradle/src RUN gradle bootJar --no-daemon -FROM openjdk:17 +FROM openjdk:17-jdk-bullseye +RUN apt-get update && apt-get -y install graphviz && apt-get clean RUN mkdir /app COPY --from=build /home/gradle/src/build/libs/*.jar /app/app.jar ENTRYPOINT ["java","-jar","/app/app.jar"]