diff --git a/.gitlab-ci.main.kts b/.gitlab-ci.main.kts new file mode 100755 index 00000000..6aa69277 --- /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 039a0e48..fc4a18fc 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 2/2] 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 54b57870..00000000 --- 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 01cc8c45..e210301a 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.