diff --git a/docs/website/.gitlab-ci.yml b/docs/website/.gitlab-ci.yml index 727106f..6c3b272 100644 --- a/docs/website/.gitlab-ci.yml +++ b/docs/website/.gitlab-ci.yml @@ -6,6 +6,7 @@ mkdocs: needs: [ os.version ] before_script: + - ./docs/website/verify-marker.sh - ./gradlew docs:website:embedDokkaIntoMkDocs -PappVersion=$project_version - cd docs/website - ls diff --git a/docs/website/verify-marker.sh b/docs/website/verify-marker.sh new file mode 100755 index 0000000..0e2fcc3 --- /dev/null +++ b/docs/website/verify-marker.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# Script to verify that Dokka marker lines are adjacent to each other in mkdocs.yml + +# Get line numbers of Dokka marker lines +START_LINE=$(grep -n "!!! EMBEDDED DOKKA START" docs/website/mkdocs.yml | cut -d':' -f1) +END_LINE=$(grep -n "!!! EMBEDDED DOKKA END" docs/website/mkdocs.yml | cut -d':' -f1) + +# Check if both markers exist +if [ -z "$START_LINE" ] || [ -z "$END_LINE" ]; then + echo "Error: The Dokka marker lines are missing from mkdocs.yml" + exit 1 +fi + +# Check if markers are adjacent +if [ $((END_LINE - START_LINE)) -ne 1 ]; then + echo "Error: The Dokka marker lines must be adjacent to each other" + echo "START line: $START_LINE, END line: $END_LINE" + echo "The Dokka table of content has been committed between the markers in the file mkdocs.yml. Please remove it before committing." + exit 1 +fi + +echo "Dokka marker lines verification passed." +exit 0 -- 2.51.2 From a955be760766c1b8051b1435dbe519be4a99c0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Tue, 29 Apr 2025 21:40:32 +0200 Subject: [PATCH 2/3] ci(gitlab): Setup running pipelines in Kotlin --- .gitlab-ci.main.kts | 25 +++++++++++++++++++++++++ .gitlab-ci.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100755 .gitlab-ci.main.kts diff --git a/.gitlab-ci.main.kts b/.gitlab-ci.main.kts new file mode 100755 index 0000000..6aa6927 --- /dev/null +++ b/.gitlab-ci.main.kts @@ -0,0 +1,25 @@ +#!/usr/bin/env kotlin + +// https://gitlab.com/opensavvy/automation/gitlab-ci.kt/-/releases +@file:DependsOn("dev.opensavvy.gitlab:gitlab-ci-kotlin-jvm:0.5.0") + +import opensavvy.gitlab.ci.gitlabCi +import opensavvy.gitlab.ci.job +import opensavvy.gitlab.ci.script.shell +import opensavvy.gitlab.ci.stage + +gitlabCi { + val test by stage() + + val helloWorld by job(stage = test) { + script { + shell("echo 'Hello world'") + } + } +}.println() + +println(""" + workflow: + rules: + - if: ${'$'}CI_PIPELINE_SOURCE == "parent_pipeline" +""".trimIndent()) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 039a0e4..fc4a18f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,3 +72,33 @@ pages: interruptible: false # endregion +# region Kotlin pipeline + +gitlab-ci.main.kts compile: + stage: .pre + image: registry.gitlab.com/opensavvy/automation/containers/kotlin:$ci_containers + needs: [] + variables: + GIT_DEPTH: 1 + script: + - ./.gitlab-ci.main.kts >kotlin-ci.yml + artifacts: + paths: + - kotlin-ci.yml + interruptible: true + +gitlab-ci.main.kts run: + stage: .pre + needs: [ "gitlab-ci.main.kts compile", "os.version" ] + trigger: + include: + - artifact: kotlin-ci.yml + job: "gitlab-ci.main.kts compile" + strategy: depend + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + - if: $CI_PIPELINE_SOURCE == 'schedule' + - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH + - if: $CI_COMMIT_TAG + +# endregion -- 2.51.2 From 6ccd086ec578a2ea76cecf4f0ecc287df4ae1dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=E2=80=9CCLOVIS=E2=80=9D=20Canet?= Date: Mon, 5 May 2025 16:06:17 +0200 Subject: [PATCH 3/3] build(gitpod): Remove the GitPod configuration GitPod now supports DevContainer (https://www.gitpod.io/docs/flex/configuration/devcontainer/overview) which is a more complete specification. Since we already have the DevContainer configuration, there is no need to also have a GitPod configuration. --- .gitpod.yml | 3 --- README.md | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 54b5787..0000000 --- a/.gitpod.yml +++ /dev/null @@ -1,3 +0,0 @@ -tasks: - - name: Start - command: echo Hello World diff --git a/README.md b/README.md index 01cc8c4..e210301 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). - To learn more about our coding conventions and workflow, see the [OpenSavvy website](https://opensavvy.dev/open-source/index.html). - This project is based on the [OpenSavvy Playground](docs/playground/README.md), a collection of preconfigured project templates. -If you don't want to clone this project on your machine, it is also available using [GitPod](https://www.gitpod.io/) and [DevContainer](https://containers.dev/) ([VS Code](https://code.visualstudio.com/docs/devcontainers/containers) • [IntelliJ & JetBrains IDEs](https://www.jetbrains.com/help/idea/connect-to-devcontainer.html)). Don't hesitate to create issues if you have problems getting the project up and running. +If you don't want to clone this project on your machine, it is also available using [DevContainer](https://containers.dev/) (open in [VS Code](https://code.visualstudio.com/docs/devcontainers/containers) • [IntelliJ & JetBrains IDEs](https://www.jetbrains.com/help/idea/connect-to-devcontainer.html)). Don't hesitate to create issues if you have problems getting the project up and running.