generated from opensafely-core/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We want to configure our tasks with slightly more of an environment than a direct invocation gives us so this sets up a directory of shell scripts for each, currently used, cron invocation. In particular we want the GitHub and Slack ingestors to look for data from yesterday so we get a full days data and that needs access to `date`.
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"cron": [ | ||
{ | ||
"command": "cron/daily.sh", | ||
"schedule": "@daily" | ||
}, | ||
{ | ||
"command": "cron/weekly.sh", | ||
"schedule": "@weekly" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# we want to get data for a full day, an easy way to do this is to always look | ||
# at yesterday's data. | ||
# the yesterday variable is here to make it easier for commands to do that, but | ||
# there's no requirement that they do. | ||
yesterday=$(date -d "1 day ago" '+%F') | ||
|
||
# ebmdatalab PR stats | ||
python -m metrics github pr-queue ebmdatalab "$yesterday" | ||
python -m metrics github pr-queue ebmdatalab "$yesterday" --days-threshold=2 | ||
python -m metrics github pr-queue ebmdatalab "$yesterday" --days-threshold=10 | ||
python -m metrics github pr-queue ebmdatalab "$yesterday" --days-threshold=30 | ||
python -m metrics github pr-queue ebmdatalab "$yesterday" --days-threshold=60 | ||
python -m metrics github pr-throughput ebmdatalab "$yesterday" | ||
|
||
# opensafely PR stats | ||
python -m metrics github pr-queue opensafely "$yesterday" | ||
python -m metrics github pr-queue opensafely "$yesterday" --days-threshold=2 | ||
python -m metrics github pr-queue opensafely "$yesterday" --days-threshold=10 | ||
python -m metrics github pr-queue opensafely "$yesterday" --days-threshold=30 | ||
python -m metrics github pr-queue opensafely "$yesterday" --days-threshold=60 | ||
|
||
# slack | ||
python -m metrics slack tech-support "$yesterday" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
yesterday=$(date -d "1 day ago" '+%F') | ||
|
||
python -m metrics github pr-throughput ebmdatalab "$yesterday" --days=7 | ||
python -m metrics github pr-throughput opensafely "$yesterday" --days=7 |