Giter Site home page Giter Site logo

gitlab-ci-kotlin-dsl's Introduction

Gitlab CI Kotlin DSL

This is the Kotlin DSL to generate Gitlab CI yaml file

Example

gitlabCi {
    default {
        image("openjdk:8u162")

        cache("./gradle/wrapper", "./gradle/caches")

        beforeScript("export GRADLE_USER_HOME=\$(pwd)/.gradle")
    }

    stages {
        +"test"
        +"release"
    }

    job("build") {
        stage = "test"
        script("./gradlew clean build")
        artifacts {
            whenUpload = WhenUploadType.ALWAYS
            paths("build/test-results", "build/reports")
            expireIn = Duration(days = 7)
            reports {
                junit("build/test-results/test/TEST-*.xml")
            }
        }
    }

    job("release") {
        stage = "release"
        script("./gradlew publishToMavenLocal")
        only {
            master()
        }
        artifacts {
            whenUpload = WhenUploadType.ON_SUCCESS
            paths("build/libs")
            expireIn = Duration(days = 7)
        }
    }
}

How to download

Library is available in Central Maven Repository

<dependency>
  <groupId>com.github.pcimcioch</groupId>
  <artifactId>gitlab-ci-kotlin-dsl</artifactId>
  <version>1.2.0</version>
</dependency>
implementation("com.github.pcimcioch:gitlab-ci-kotlin-dsl:1.2.0")

It uses kotlin-datetime api which is in early stage of development and is currently only available in kotlinx bintray repository.

repositories {
    maven(url = "https://kotlin.bintray.com/kotlinx/") // soon will be just jcenter()
}

Documentation

All supported features are documented in Features Page

How to use

  1. One way to use this DSL is to create custom Kotlin project, that will be responsible for creating .gitlab-ci.yml file. Example
  2. Also, if you are using gradle, it already supports kotlin, so you can create simple gradle task to generate .gitlab-ci.yml file. Example
  3. GitlabCi can also generate pipeline automatically using child pipelines feature. Example

gitlab-ci-kotlin-dsl's People

Contributors

pcimcioch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.