From 055e5bab5ed94b8fc6a0c81643cb0cf33e75d703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Fri, 28 Nov 2025 10:25:33 +0100 Subject: [PATCH 1/8] clarify which repo the setup is on --- lab-01-get-ready.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lab-01-get-ready.md b/lab-01-get-ready.md index 106b79f..78840af 100644 --- a/lab-01-get-ready.md +++ b/lab-01-get-ready.md @@ -3,7 +3,7 @@ ## Learning Goals - Create a Kosli account -- Fork and set up the sample application repository +- Set up this repository on your GitHub account - Verify that the CI/CD pipeline runs successfully - Understand the basic structure of the application and its deployment process From bdf9f1ecc8cc861d0d3928897a1ad1959a1dd5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Fri, 28 Nov 2025 10:27:09 +0100 Subject: [PATCH 2/8] add missing parenthesis --- lab-01-get-ready.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lab-01-get-ready.md b/lab-01-get-ready.md index 78840af..b1164c3 100644 --- a/lab-01-get-ready.md +++ b/lab-01-get-ready.md @@ -40,7 +40,7 @@ In this lab, you will: #### Create a Kosli account -- Navigate to [kosli.com/sign-up]) +- Navigate to [kosli.com/sign-up]() - Choose to sign up with GitHub - Complete the registration process - Verify your email address if required From 9abe4bda642ff2e9fc4089dfb310bfd411c4724d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Fri, 28 Nov 2025 10:28:08 +0100 Subject: [PATCH 3/8] clarify creating template steps --- lab-01-get-ready.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lab-01-get-ready.md b/lab-01-get-ready.md index b1164c3..db48f6a 100644 --- a/lab-01-get-ready.md +++ b/lab-01-get-ready.md @@ -52,7 +52,10 @@ So far so good :tada:. We will go a lot more in detail with Kosli in the next se - Navigate to the labs repositorys main page (the repository you're currently viewing) - Click the "Use this template" button in the top-right corner of the page -- Select your personal GitHub account as the destination +- Select "Create a new repository" +- Select your personal GitHub account as the "Owner" and name the repository `labs` +- Optionally, add a description and choose to make the repository public or private +- Click "Create repository from template" - Wait for GitHub to complete the copy process - You should now have a copy at `https://github.com/YOUR-GITHUB-USERNAME/labs` From cdb41c1dd0a3a287fa4fa12fe85fdf5036d16cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Fri, 28 Nov 2025 10:54:24 +0100 Subject: [PATCH 4/8] fix failing component test --- ci/component-test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/component-test.sh b/ci/component-test.sh index 3479f20..a910f32 100644 --- a/ci/component-test.sh +++ b/ci/component-test.sh @@ -1,3 +1,4 @@ #! /bin/bash [[ -z "${docker_username}" ]] && DockerRepo='' || DockerRepo="${docker_username}/" +echo "$docker_password" | docker login ghcr.io --username "$docker_username" --password-stdin docker_username=$DockerRepo docker compose -f component-test/docker-compose.yml --project-directory . -p ci up --build --exit-code-from test \ No newline at end of file From 57b37f727bb90fa5fa2f34f00926fc76058ebe84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Fri, 28 Nov 2025 10:57:58 +0100 Subject: [PATCH 5/8] fix failing performance test --- ci/performance-test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/performance-test.sh b/ci/performance-test.sh index 312a270..2e55231 100644 --- a/ci/performance-test.sh +++ b/ci/performance-test.sh @@ -1,3 +1,4 @@ #! /bin/bash [[ -z "${docker_username}" ]] && DockerRepo='' || DockerRepo="${docker_username}/" +echo "$docker_password" | docker login ghcr.io --username "$docker_username" --password-stdin docker_username=$DockerRepo docker compose -f performance-test/docker-compose.yml --project-directory . -p ci up --build --exit-code-from test \ No newline at end of file From f5aed9382920acf6b0390c2c7d04e6e04ecec6c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Fri, 28 Nov 2025 11:14:40 +0100 Subject: [PATCH 6/8] fix failing security test --- .github/workflows/full-pipeline.yaml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/full-pipeline.yaml b/.github/workflows/full-pipeline.yaml index 2b343c2..b44549c 100644 --- a/.github/workflows/full-pipeline.yaml +++ b/.github/workflows/full-pipeline.yaml @@ -1,7 +1,7 @@ name: Main workflow on: [push, workflow_dispatch] env: # Set the secret as an input - docker_username: ${{ github.actor }} + docker_username: ${{ github.actor }} docker_password: ${{ secrets.GITHUB_TOKEN }} #Nees to be set to be made available to the workflow APP_NAME: ${{ github.event.repository.name }} BUILD_NUMBER: ${{ github.run_number }} @@ -12,21 +12,21 @@ env: # Set the secret as an input IMAGE: ${{ github.repository_owner }}/${{ github.event.repository.name }} BUILD_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} COMMIT_URL: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }} - + jobs: Build: runs-on: ubuntu-latest container: gradle:6-jdk11 steps: - name: Clone down repository - uses: actions/checkout@v4 + uses: actions/checkout@v4 - name: Build application run: bash ci/build-app.sh - name: Test run: bash ci/unit-test-app.sh - name: Upload repo uses: actions/upload-artifact@v4 - with: + with: name: code path: . include-hidden-files: true @@ -40,12 +40,12 @@ jobs: name: code path: . - name: run linting - uses: super-linter/super-linter/slim@v7 + uses: super-linter/super-linter/slim@v7 env: DEFAULT_BRANCH: main # To report GitHub Actions status checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DISABLE_ERRORS: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DISABLE_ERRORS: true Docker-image: runs-on: ubuntu-latest needs: [Build] @@ -79,6 +79,12 @@ jobs: with: name: code path: . + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: @@ -109,7 +115,7 @@ jobs: name: code path: . - name: Execute performance test - run: bash ci/performance-test.sh + run: bash ci/performance-test.sh Deploy: runs-on: ubuntu-latest needs: [Docker-image, Security-scan, Component-test, Performance-test] @@ -117,7 +123,7 @@ jobs: - name: Download code uses: actions/download-artifact@v4 with: - name: code + name: code path: . - name: Deploy to production run: bash ci/start-application.sh From e328ea34711df16befb6737cb288422bb1eaa1f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Fri, 28 Nov 2025 12:16:09 +0100 Subject: [PATCH 7/8] fix deployment job --- .github/workflows/full-pipeline.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/full-pipeline.yaml b/.github/workflows/full-pipeline.yaml index b44549c..b98c46e 100644 --- a/.github/workflows/full-pipeline.yaml +++ b/.github/workflows/full-pipeline.yaml @@ -125,6 +125,12 @@ jobs: with: name: code path: . + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Deploy to production run: bash ci/start-application.sh - name: stop production environment From 7375e379f266337489cd4e0425903c78462bb847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Gr=C3=B8ndahl?= Date: Fri, 28 Nov 2025 12:19:21 +0100 Subject: [PATCH 8/8] clarify where to find package and minor changes --- lab-01-get-ready.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lab-01-get-ready.md b/lab-01-get-ready.md index db48f6a..256c99c 100644 --- a/lab-01-get-ready.md +++ b/lab-01-get-ready.md @@ -111,7 +111,7 @@ So far so good :tada:. We will go a lot more in detail with Kosli in the next se #### View the Docker image 1. Go to your GitHub profile page -2. Click on "Packages" tab +2. Click on "Packages" in the left sidebar 3. You should see the `labs` package 4. Click on it to view details about the Docker image 5. Note the image tag (usually `latest`) and the SHA digest @@ -123,7 +123,7 @@ So far so good :tada:. We will go a lot more in detail with Kosli in the next se Before moving to the next lab, ensure you have: - ✅ A Kosli account at app.kosli.com with an organization created -- ✅ A forked copy of the labs repository under your GitHub account +- ✅ A copy of the labs repository under your GitHub account - ✅ GitHub Actions successfully completed all jobs in the workflow - ✅ A Docker image published to your GitHub Container Registry - ✅ Understanding of the basic pipeline structure