-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.dhall
121 lines (110 loc) · 3.72 KB
/
example.dhall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
let Concourse =
./deps/concourse.dhall
? https://raw.githubusercontent.com/akshaymankar/dhall-concourse/master/package.dhall
let DockerImage =
./package.dhall
? https://raw.githubusercontent.com/dhall-concourse/git-resource/master/package.dhall
let resource =
-- Use Source to define source.
-- And use Source.render to render it as `Optional (Prelude.Map.Type Text Prelude.JSON.Type)`
Concourse.schemas.Resource::{
, name = "test-docker-image"
, type = Concourse.Types.ResourceType.InBuilt "docker-image"
, source =
DockerImage.Source.render
DockerImage.Source::{ repository = "ubuntu" }
}
let get =
Concourse.helpers.getStep
Concourse.schemas.GetStep::{
, resource = resource
, params =
DockerImage.InParams.render
DockerImage.InParams::{ save = Some True }
}
let buildParams =
DockerImage.OutParams::{
, image_from =
DockerImage.OutParams.ImageFrom.Type.Build
DockerImage.OutParams.ImageFrom.Build::{
, build = "some-repo/build-path"
, dockerfile = Some "some-repo/build-path/Dockerfile.test"
}
}
let putBuild =
Concourse.helpers.putStep
Concourse.schemas.PutStep::{
, resource = resource
, params = DockerImage.OutParams.render buildParams
}
let putImport =
Concourse.helpers.putStep
Concourse.schemas.PutStep::{
, resource = resource
, params =
DockerImage.OutParams.render
DockerImage.OutParams::{
, image_from =
DockerImage.OutParams.ImageFrom.Type.ImportFile "path/to/file"
}
}
let putLoad =
Concourse.helpers.putStep
Concourse.schemas.PutStep::{
, resource = resource
, params =
DockerImage.OutParams.render
DockerImage.OutParams::{
, image_from =
DockerImage.OutParams.ImageFrom.Type.Load "path/to/dir"
}
}
let putLoadFile =
Concourse.helpers.putStep
Concourse.schemas.PutStep::{
, resource = resource
, params =
DockerImage.OutParams.render
DockerImage.OutParams::{
, image_from =
DockerImage.OutParams.ImageFrom.Type.LoadFile
{ load_file = "path/to/file"
, load_repository = "example.com/docker/repo"
, load_tag = Some "tag"
}
}
}
let putPullRepo =
Concourse.helpers.putStep
Concourse.schemas.PutStep::{
, resource = resource
, params =
DockerImage.OutParams.render
DockerImage.OutParams::{
, image_from =
DockerImage.OutParams.ImageFrom.Type.PullRepository
{ repository = "example.com/docker/repo"
, pull_tag = Some "tag"
}
}
}
let task =
Concourse.helpers.taskStep
Concourse.schemas.TaskStep::{
, task = "test-image-resource"
, config =
Concourse.Types.TaskSpec.Config
Concourse.schemas.TaskConfig::{
, image_resource =
DockerImage.ImageResource.render
DockerImage.ImageResource::{
, source = DockerImage.Source::{ repository = "ubuntu" }
}
, run = Concourse.schemas.TaskRunConfig::{ path = "true" }
}
}
in Concourse.schemas.Job::{
, name = "example"
, plan =
[ get, putBuild, putImport, putLoad, putLoadFile, putPullRepo, task ]
}