Coder Social home page Coder Social logo

dhall-gitlab-ci's Introduction

dhall-gitlab-ci: A Dhall representation of gitlab-ci.yml

This is a Dhall encoding of the GitLab CI configuration schema.

See code under the examples folder or checkout the dhall-gitlab-pipeline for a more complete project example.

let GitLab =
      https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/package.dhall

let Prelude = GitLab.Prelude

let renderTop = GitLab.Top.toJSON

let demoJob =
      GitLab.Job::{
      , stage = Some "build"
      , image = Some { name = "alpine:latest", entrypoint = Some [ " " ] }
      , script = [ "echo 'Hello World'" ]
      }

let top = GitLab.Top::{ jobs = toMap { generated-job = demoJob } }

in  Prelude.JSON.renderYAML (renderTop top)
let GitLab = ../package.dhall

let Prelude = GitLab.Prelude

let List/map = Prelude.List.map

let Map = Prelude.Map.Type

let Job = GitLab.Job.Type

let renderTop = GitLab.Top.toJSON

let buildDir = "build"

let targets = [ "package-1", "package-2" ]

let mkJob =
      λ(target : Text) 
        GitLab.Job::{
        , stage = Some "build"
        , image = Some { name = "alpine:latest", entrypoint = Some [ " " ] }
        , script = [ "echo 'Building ${buildDir}/${target} World'" ]
        }

let jobList
    : List { mapKey : Text, mapValue : Job }
    = List/map
        Text
        { mapKey : Text, mapValue : Job }
        (λ(target : Text)  { mapKey = target, mapValue = mkJob target })
        targets

let jobMap
    : Map Text Job
    = jobList

let top = GitLab.Top::{ jobs = jobMap }

in  Prelude.JSON.renderYAML (renderTop top)

dhall-gitlab-ci's People

Contributors

bgamari avatar krakrjak avatar masser avatar mx00s 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.