Are you tired of YAML to write your CI pipelines? ...
# feed
c
Are you tired of YAML to write your CI pipelines? Introducing .gitlab-ci.main.kts, a Kotlin Script DSL for creating GitLab CI pipelines.
Copy code
gitlabCi {
    val helloWorld by job {
        script {
            shell("echo Hello world!")
        }
    }
}.println()
generates:
Copy code
helloWorld:
  script:
    - echo Hello world!
Plugins allow pre-configuring other tools, for example Gradle:
Copy code
gitlabCi {
    val build by job {
        useGradle()

        script {
            gradlew.task("build")
        }
    }
}.println()
generates:
Copy code
build: 
  variables: 
    GRADLE_USER_HOME: $CI_BUILDS_DIR/.gradle
  cache: 
    paths: 
      - .gradle/wrapper
    key: 
      files: 
        - gradle/wrapper/gradle-wrapper.properties
  script: 
    - ./gradlew build
which automatically configures caching for the Gradle Wrapper files. https://opensavvy.gitlab.io/automation/gitlab-ci.kt/docs
K 8
👍 1
🧵 1
c
Related: #C02UUATR7RC
👍 2