Morning everyone, I spotted this repo recently <h...
# opensavvy
b
Morning everyone, I spotted this repo recently https://gitlab.com/opensavvy/automation/gitlab-ci.kt which looks promessing šŸ‘ . What isn’t clear though is how you get GitLab CI to execute the
gitlab-ci.main.kts
file? Thanks
c
Hey! There are two main ways: • Either you execute it yourself and commit the resulting
.gitlab-ci.yml
file to the repository • Or you use a dynamic child pipeline to execute your script and communicate the results to GitLab I'll be reworking the documentation soon, are there any specific things you'd like to see?
b
Thanks for clarifying! Option 1 is what I expected. I was hoping for a tighter integration with Gitlab CI than option 2 but that might not a deal breaker. Where I work we have written an extensive template for GitLab CI pipelines but we are struggling to further extend the template to support other deployment models and compiler toolchains. I’m thinking this gitlab-ci lib could be retrofitted in our template to abstract some core capabilities in a Kotlin DSL that other can build upon to extend the template capabilties.
c
Yeah, that's my goal as well. If you look into the `plugins` package, you'll see that I created helpers for Gradle and other common tools;
Copy code
val build by job {
    useGradle()
    script {
        gradlew.task("build")
    }
}
b
Pretty nice DSL! Just one thing I notice: there are no DslMarker annotations. Intentional?
c
Not really, I just didn't know about DslMarker when I worked on the project. i'll add the marker at some point