-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.dhall
193 lines (175 loc) · 5.67 KB
/
package.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
let Containerfile =
https://raw.githubusercontent.com/softwarefactory-project/dhall-containerfile/0.3.0/package.dhall sha256:03a6e298ff140d430cea8b387fad886ce9f5bee24622c7d1102115cc08ed9cf9
let NpmPackage =
~/src/softwarefactory-project.io/software-factory/dhall-npm-package/package.dhall
let Text/concatSep =
https://prelude.dhall-lang.org/Text/concatSep.dhall sha256:e4401d69918c61b92a4c0288f7d60a6560ca99726138ed8ebc58dca2cd205e58
let CiPackages =
[ "make"
, "findutils"
, "openssl-devel"
, "rsync"
, "git"
, "python3"
, "curl"
, "tar"
, "bzip2"
, "xz"
]
let NpmPackages = [ "nodejs", "yarnpkg" ]
let RpmBuildPackages = [ "createrepo", "rpm-build", "rpmdevtools" ]
let StackPackages =
[ "Glob"
, "HsYAML"
, "QuickCheck"
, "megaparsec"
, "quickcheck-instances"
, "scientific"
, "tasty-quickcheck"
, "tasty-expected-failure"
, "aeson"
, "aeson-casing"
, "ansi-wl-pprint"
, "async"
, "blaze-html"
, "bytestring"
, "containers"
, "co-log"
, "cryptonite"
, "directory"
, "dhall"
, "doctest"
, "extra"
, "filepath"
, "haxr"
, "http-client"
, "http-client-tls"
, "http-directory"
, "http-types"
, "irc-client"
, "managed"
, "mtl"
, "network-uri"
, "optparse-generic"
, "random"
, "relude"
, "simple-cmd"
, "simple-cmd-args"
, "tasty"
, "tasty-hunit"
, "text"
, "time"
, "turtle"
, "vector"
, "versions"
, "wai"
, "warp"
, "yaml"
]
let stack =
\(fedora-release : Natural) ->
let --| TODO: change the resolver value based on fedora release
resolver =
"lts-16.15"
in "stack --system-ghc --resolver ${resolver}"
let fedora =
\(fedora-release : Natural) ->
"registry.fedoraproject.org/fedora:${Natural/show fedora-release}"
let StackBuilder =
\(fedora-release : Natural) ->
\(packages : List Text) ->
let stack = stack fedora-release
in Containerfile.from (fedora fedora-release)
# Containerfile.run
"Install requirements"
[ "dnf update -y"
, "dnf install -y ghc stack gmp-devel make findutils openssl-devel rsync git python3 curl tar bzip2"
, "dnf clean all"
]
# Containerfile.run
"Setup stack"
[ "${stack} setup", "${stack} update" ]
# Containerfile.run
"Prepare build"
[ "${stack} install --prefetch --dry-run "
++ Text/concatSep " " packages
]
# Containerfile.run
"Install build dependencies"
[ "${stack} install " ++ Text/concatSep " " packages ]
let StackContainer =
\(fedora-release : Natural) ->
\(builder-ref : Text) ->
\(name : Text) ->
let fedora-req = [ "glibc", "gmp", "ncurses-libs" ]
let stack = stack fedora-release
let git-rev = env:GIT_REV as Text ? "master"
in Containerfile.from (builder-ref ++ " as builder")
# Containerfile.run
"Build project"
[ "cd /usr/src/${name}"
, "echo Building ${name} ${git-rev}"
, "${stack} clean"
, "${stack} build --copy-bins"
, "cp /root/.local/bin/${name} /tmp"
]
# Containerfile.from (fedora fedora-release)
# Containerfile.copyFrom
"builder"
[ "/tmp/${name}", "/bin/${name}" ]
# Containerfile.volume [ "/data" ]
# Containerfile.entrypoint [ "/bin/${name}" ]
let NodeBuilder =
\(fedora-release : Natural) ->
Containerfile.from (fedora fedora-release)
# Containerfile.run
"Install requirements"
[ "dnf update -y"
, "dnf install -y "
++ Text/concatSep
" "
(CiPackages # NpmPackages # RpmBuildPackages)
, "dnf clean all"
]
# Containerfile.copy
[ "package.json", "/usr/libexec/shake/package.json" ]
# Containerfile.run
"Install node dependencies"
[ "cd /usr/libexec/shake", "yarn install" ]
let NodeDependencies =
NpmPackage::{
, name = "builder"
, version = "0.1.0"
, private = Some True
, dependencies = Some
( toMap
{ react = "^16.13.1"
, react-dom = "^16.13.1"
, reason-react = "^0.9.1"
, bs-platform = "^8.2.0"
, decco = "^1.3.0"
, tablecloth-bucklescript =
"https://github.com/darklang/tablecloth"
, `@justgage/reason-cookie` = "^0.1.2"
, js-yaml = "^3.14.0"
, `@reasonml-community/graphql-ppx` = "^1.0.0-beta.22"
, `@patternfly/react-core` = "^4.50.2"
, `@patternfly/react-table` = "^4.18.14"
, `@patternfly/react-icons` = "^4.7.12"
, `@patternfly/react-charts` = "^6.11.3"
, `@glennsl/bs-jest` = "^0.5.1"
, `@glennsl/bs-json` = "^5.0.2"
, bs-webapi = "^0.19.1"
, bs-fetch = "^0.6.2"
, parcel = "^1.12.4"
, jest = "^26.5.0"
}
)
}
in { Container =
{ Stack = StackContainer 33
, StackBuilder = StackBuilder 33 StackPackages
, NodeBuilder = NodeBuilder 33
, NodeDependencies
}
}