forked from softwarefactory-project/dhall-prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shakefile.hs
27 lines (23 loc) · 1.06 KB
/
Shakefile.hs
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
-- Interpret using this command:
-- podman run -it --rm -v $(pwd):/data:Z quay.io/software-factory/shake-factory
--
-- Learn more at: https://softwarefactory-project.io/cgit/software-factory/shake-factory/tree/README.md
import Development.Shake
import ShakeFactory
import ShakeFactory.Dhall
storeUrl :: String
storeUrl = "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/"
updateSchemas :: Action ()
updateSchemas = do
cmd_ "python3" "scripts/schemastore-to-dhall.py" "Config" (storeUrl <> "prometheus.json")
cmd_ "python3" "scripts/schemastore-to-dhall.py" "RulesConfig" (storeUrl <> "prometheus.rules.json")
cmd_ "find" "." "-name" "*.dhall" "-exec" "dhall" "--ascii" "format" "--inplace" "{}" ";"
main = shakeMain $ do
want ["README.md", "package.dhall"]
"README.md" %> dhallReadmeAction
"package.dhall" %> dhallTopLevelPackageAction "./Prometheus/package.dhall"
"//package.dhall" %> dhallPackageAction
dhallDocsRules "dhall-prometheus"
dhallReleaseRules "./Prometheus/package.dhall"
phony "update" updateSchemas
cleanRules