-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helper script to execute pytest on the dev server
HEDWG2-1197
- Loading branch information
Showing
2 changed files
with
33 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
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,32 @@ | ||
#!/bin/bash | ||
|
||
echo | ||
if [[ ! $(prefect config view | grep PREFECT_API_KEY) ]]; then | ||
echo "PREFECT_API_KEY is not set; Set using 'prefect config set PREFECT_API_KEY=*****'"; | ||
exit 1; | ||
fi | ||
|
||
branch=`git branch --show-current` | ||
echo "Sending pytest runner for branch=$branch"; | ||
echo "Make sure you are connected to NIAID VPN"; | ||
echo | ||
|
||
if [[ ! $(git branch -r | grep $branch) ]]; then | ||
echo "Push the branch to remote before executing this action."; | ||
echo | ||
exit 1; | ||
else | ||
echo "Make sure the branch is up to date in remote" | ||
echo | ||
fi | ||
|
||
run_id=$(curl -i -X POST \ | ||
"https://prefect2.hedwig-workflow-api.niaiddev.net/api/deployments/d87fc0e8-5c71-408a-bcbe-f2a6320686d1/create_flow_run" \ | ||
-H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $PREFECT_API_KEY" \ | ||
-d "{\"parameters\": {\"git_branch\":\"$branch\"}}" | \ | ||
sed -n 's/.*\([0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}\).*/\1/p') | ||
|
||
flow="https://prefect2.hedwig-workflow-api.niaiddev.net/flow-runs/flow-run/$run_id" | ||
echo | ||
echo "Flow Run can be accessed here: $flow"; | ||
echo |