Skip to content

Commit

Permalink
Add tags to resources as well
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaymankar committed Feb 27, 2020
1 parent 152dd52 commit 6cd4d28
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
17 changes: 14 additions & 3 deletions helpers/addTags.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ let addTagsToGet
λ(h : Types.StepHooks Step)
λ(S : Type)
λ(c : StepConstructors S)
c.get (g { tags = mergeTags g.tags tags }) (translateHooks S c h)
c.get
( g
{ tags = mergeTags g.tags tags
, resource = ./addTagsToResource.dhall tags g.resource
}
)
(translateHooks S c h)

let addTagsToPut
: List Text Types.PutStep Types.StepHooks Step Step
Expand All @@ -38,7 +44,13 @@ let addTagsToPut
λ(h : Types.StepHooks Step)
λ(S : Type)
λ(c : StepConstructors S)
c.put (p { tags = mergeTags p.tags tags }) (translateHooks S c h)
c.put
( p
{ tags = mergeTags p.tags tags
, resource = ./addTagsToResource.dhall tags p.resource
}
)
(translateHooks S c h)

let addTagsToTask
: List Text Types.TaskStep Types.StepHooks Step Step
Expand All @@ -49,7 +61,6 @@ let addTagsToTask
λ(c : StepConstructors S)
c.task (t { tags = mergeTags t.tags tags }) (translateHooks S c h)


let addTagsToStep
: List Text Step Step
= λ(tags : List Text)
Expand Down
8 changes: 8 additions & 0 deletions helpers/addTagsToResource.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
λ(tags : List Text)
λ(r : ../types/Resource.dhall)
r
{ tags =
merge
{ None = Some tags, Some = λ(ts : List Text) Some (ts # tags) }
r.tags
}
2 changes: 1 addition & 1 deletion helpers/package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
./tryWithHooks.dhall sha256:b1808275879f924e73fd9c12393f04a9563c8f1a74743f5ac125d9849b912b0d
? ./tryWithHooks.dhall
, addTags =
./addTags.dhall sha256:e802dce26e2b99c4dd7c529baa520b95199916e3b4a0733eabbb1d31d975e7a4
./addTags.dhall sha256:646935e099f817d6d1e1bce332009a53a3ec02c21bfa1d41a9697fc772bcc423
? ./addTags.dhall
}
2 changes: 1 addition & 1 deletion package.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
./schemas/package.dhall sha256:bf3838a202e3d5d7f5b764229b069423ec54d2c6a8ea1658a1036ad855750bbd
? ./schemas/package.dhall
, helpers =
./helpers/package.dhall sha256:a67c79710e278028af87b35e9320224a6b217540126b5fc7095a67ce416c0068
./helpers/package.dhall sha256:bdca90b462850d40f056cdca9bef76a9004a6d89477b161c89c5ae76a2223c75
? ./helpers/package.dhall
, render =
./render/package.dhall sha256:102ffaeffabf83db684c6c1ee9c30023ad080aea4a776328f6fd7d3a8d4b1309
Expand Down

0 comments on commit 6cd4d28

Please sign in to comment.