drone generation
This commit is contained in:
commit
5832f9393d
|
@ -0,0 +1,15 @@
|
|||
let drone = ../types.dhall
|
||||
|
||||
let dockerHost = ./dockerHost.dhall
|
||||
|
||||
let dockerBuild
|
||||
: Text → drone.Step.Type
|
||||
= λ(imageName : Text)
|
||||
→ drone.Step::{
|
||||
, name = "build image ${imageName}"
|
||||
, volumes = Some [ dockerHost.step ]
|
||||
, image = "docker:dind"
|
||||
, commands = [ "docker build -t ${imageName} ." ]
|
||||
}
|
||||
|
||||
in dockerBuild
|
|
@ -0,0 +1,8 @@
|
|||
let drone = ../types.dhall
|
||||
|
||||
in { pipeline = drone.Volume::{
|
||||
, name = "dockersock"
|
||||
, host = Some drone.HostVolume::{ path = "/var/run/docker.sock" }
|
||||
}
|
||||
, step = drone.StepVolume::{ name = "dockersock", path = "/var/run" }
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
let drone = ../types.dhall
|
||||
|
||||
let image = env:GO_IMAGE ? "xena/go:1.13.6"
|
||||
|
||||
let step =
|
||||
drone.Step::{
|
||||
, name = "go test"
|
||||
, image = image
|
||||
, commands = [ "go test ./..." ]
|
||||
}
|
||||
|
||||
in step
|
|
@ -0,0 +1,14 @@
|
|||
let drone = ./types.dhall
|
||||
|
||||
let dockerBuild = ./common/dockerBuild.dhall
|
||||
|
||||
let dockerHost = ./common/dockerHost.dhall
|
||||
|
||||
let pl =
|
||||
drone.Pipeline::{
|
||||
, name = "go"
|
||||
, steps = [ ./common/go.dhall, dockerBuild "xena/test" ]
|
||||
, volumes = Some [ dockerHost.pipeline ]
|
||||
}
|
||||
|
||||
in pl
|
|
@ -0,0 +1,6 @@
|
|||
{ Step = ./types/step.dhall
|
||||
, StepVolume = ./types/stepVolume.dhall
|
||||
, HostVolume = ./types/hostVolume.dhall
|
||||
, Volume = ./types/volume.dhall
|
||||
, Pipeline = ./types/pipeline.dhall
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{ Type = { path : Text }, default = { path = "" } }
|
|
@ -0,0 +1,19 @@
|
|||
let Volume = ./volume.dhall
|
||||
|
||||
let Step = ./step.dhall
|
||||
|
||||
in { Type =
|
||||
{ kind : Text
|
||||
, name : Text
|
||||
, type : Text
|
||||
, steps : List Step.Type
|
||||
, volumes : Optional (List Volume.Type)
|
||||
}
|
||||
, default =
|
||||
{ kind = "pipeline"
|
||||
, type = "docker"
|
||||
, name = "test"
|
||||
, steps = [] : List Step.Type
|
||||
, volumes = None (List Volume.Type)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
let StepVolume = ./stepVolume.dhall
|
||||
|
||||
in { Type =
|
||||
{ name : Text
|
||||
, image : Text
|
||||
, commands : List Text
|
||||
, volumes : Optional (List StepVolume.Type)
|
||||
}
|
||||
, default =
|
||||
{ name = "test"
|
||||
, image = "xena/alpine:latest"
|
||||
, commands = [ "uname -av" ]
|
||||
, volumes = None (List StepVolume.Type)
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
{ Type = { name : Text, path : Text }, default = { name = "", path = "" } }
|
|
@ -0,0 +1,5 @@
|
|||
let HostVolume = ./hostVolume.dhall
|
||||
|
||||
in { Type = { name : Text, host : Optional HostVolume.Type }
|
||||
, default = { name = "", host = None }
|
||||
}
|
Loading…
Reference in New Issue