-
Notifications
You must be signed in to change notification settings - Fork 0
Trigger build workflows for model
on sqoop
#7
Conversation
GH_API_REPOS=( | ||
"https://api.github.com/repos/ccao-data/data-architecture" | ||
"https://api.github.com/repos/ccao-data/data-architecture" | ||
) | ||
GH_API_WORKFLOWS=( | ||
"test_dbt_models.yaml" | ||
"build_and_test_dbt.yaml" | ||
) | ||
GH_API_WORKFLOW_INPUTS=( | ||
"" | ||
"model.vw_card_res_input model.vw_pin_condo_input" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty hideous but works fine. Just iterates through the index of the arrays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Nitpick, non-blocking] I love representing data in shell scripts 🙈 Perhaps a brief comment explaining the data structure would help with readability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 3bee4a2!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, just one small nitpick that I think may be a syntax error!
GH_API_REPOS=( | ||
"https://api.github.com/repos/ccao-data/data-architecture" | ||
"https://api.github.com/repos/ccao-data/data-architecture" | ||
) | ||
GH_API_WORKFLOWS=( | ||
"test_dbt_models.yaml" | ||
"build_and_test_dbt.yaml" | ||
) | ||
GH_API_WORKFLOW_INPUTS=( | ||
"" | ||
"model.vw_card_res_input model.vw_pin_condo_input" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Nitpick, non-blocking] I love representing data in shell scripts 🙈 Perhaps a brief comment explaining the data structure would help with readability?
scripts/dispatch-dbt-workflow.sh
Outdated
if [ -z "${GH_API_WORKFLOW_INPUTS[$i]}" ]; then | ||
echo '{"ref": "master"}' | ||
else | ||
echo "{\"ref\": \"master\", \"inputs\": {\"models\": \"${GH_API_WORKFLOW_INPUTS[$i]}\"}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Nitpick] Hm, I might be reading wrong here but I think we may be missing a closing brace:
echo "{\"ref\": \"master\", \"inputs\": {\"models\": \"${GH_API_WORKFLOW_INPUTS[$i]}\"}" | |
echo "{\"ref\": \"master\", \"inputs\": {\"models\": \"${GH_API_WORKFLOW_INPUTS[$i]}\"}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Fixed in 3bee4a2!
3e82a43
to
3bee4a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go!
This PR adds triggers to rebuild the main
model
input views/tables on sqoop. Once ccao-data/data-architecture#255 is merged, this will rebuild the full table every morning once sqoop is finished running.