bgamari / dhall-gitlab-ci Goto Github PK
View Code? Open in Web Editor NEWA Dhall encoding of the GitLab CI configuration schema
License: BSD 3-Clause "New" or "Revised" License
A Dhall encoding of the GitLab CI configuration schema
License: BSD 3-Clause "New" or "Revised" License
The JSON generated for a job containing a test report does NOT include that report (even though it is specified in the Dhall source). (The JSON should contain a artifacts:report:sjunit
value as specified at https://docs.gitlab.com/ee/ci/yaml/index.html#artifactsreports.)
For example, this (intended to be run from the top-level directory):
let GitLab =./package.dhall
let Prelude = GitLab.Prelude
let renderTop = GitLab.Top.toJSON
let When = GitLab.When.Type
let jobWithReport =
GitLab.Job::{
, stage = Some "build"
, image = Some { name = "alpine:latest", entrypoint = Some [ " " ] }
, script = [ "echo 'Hello World'" ]
-- generated JSON will include NOT "reports" key
, artifacts = Some
{ when = When.Always
, expire_in.seconds = 365 * 24 * 60 * 60
, paths = [ "report.xml" ]
, reports = { junit = Some "report.xml" }
}
}
let top = GitLab.Top::{ jobs = toMap {
job-with-report = jobWithReport
} }
in Prelude.JSON.renderYAML (renderTop top)
produces the following JSON, which does NOT include the artifacts:reports:junit
key:
"job-with-report":
"allow_failure": false
"artifacts":
"expire_in": "31536000 second"
"paths":
- "report.xml"
"when": "always"
"image":
"entrypoint":
- " "
"name": "alpine:latest"
"script":
- "echo 'Hello World'"
"stage": "build"
"variables": {}
"variables":
"GIT_SUBMODULE_STRATEGY": "normal"
Just wandered into the world of dhall less than a day ago, this is awesome stuff. I'm not sure how complete this repo is deemed to be, but how can I do the following:
---
image: tmaier/docker-compose
variables:
COMPOSE_FILE: 'docker-compose.yml'
...
Thanks!
The Keyword reference for the .gitlab-ci.yml file references a "when" keyword as part of the job keywords. There is no reference to this "when" keyword in the Job Type
I'm trying to run the example, using an import and it's failing with:
dhall:
↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/package.dhall
↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/GitLab/package.dhall
↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/GitLab/Job/package.dhall
↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/GitLab/Job/Type.dhall
↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/GitLab/Prelude.dhall
↳ https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/Prelude.dhall
↳ https://raw.githubusercontent.com/dhall-lang/dhall-lang/v17.0.0/Prelude/package.dhall
sha256:0c04cbe34f1f2d408e8c8b8cb0aa3ff4d5656336910f7e86190a6d14326f966d
Error: Import integrity check failed
Expected hash:
↳ 0c04cbe34f1f2d408e8c8b8cb0aa3ff4d5656336910f7e86190a6d14326f966d
Actual hash:
↳ 10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e
24│ https://raw.githubusercontent.com/dhall-lang/dhall-lang/v17.0.0/Prelude/package.dhall sha256:0c04cbe34f1f2d408e8c8b8cb0aa3ff4d5656336910f7e86190a6d14326f966d
https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/Prelude.dhall:24:3
It seems like the checksum committed is wrong.
Unlike Text
, Dhall's URL imports do not support any kind of interpolation. Consequently, updating expressions like this to use more recent revisions is awkward. I'd have to edit the git revision in multiple URL imports.
Several Dhall projects use a package.dhall
file so users can make a let
binding to its URL and access all the project's public features through it. Here is the package.dhall
for dhall-kubernetes
.
I considered whether other Dhall features could simplify maintenance in my project without asking for a package.dhall
here, but haven't found any. These issues and comments in dhall-lang
offer some useful context.
The comment following that last one about expanding the type hierarchy might be relevant to this concern, but I don't see it yet.
This project seems to be missing a license, could we have some?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.