/.github/{scripts,workflows}: print kubectl wait output on error, comment on issue after benchmarking

This commit is contained in:
Dustin Brown
2021-01-05 12:15:09 -08:00
parent 15bc86e283
commit 6dc7874951
2 changed files with 10 additions and 2 deletions
@@ -38,6 +38,7 @@ KUBECONFIG="$KUBECONFIG" kubectl apply -f job.json
out=$(KUBECONFIG="$KUBECONFIG" kubectl wait job/"$jobname" --for=condition=complete -n performance-benchmarking --timeout=600s)
if [ "$out" != "job.batch/$jobname condition met" ]; then
echo "output of kubectl wait: $out"
KUBECONFIG="$KUBECONFIG" kubectl logs job/"$jobname" -n performance-benchmarking
else
echo "::set-output name=object-key::$timeprefix/$actorprefix/comparison-results.log"
@@ -87,14 +87,21 @@ jobs:
run: |
echo "Get benchmark results here: $KEY"
aws s3api get-object --bucket=performance-benchmarking-github-actions-results --key="$KEY" results.log
echo "::set-output name=results::$(cat results.log)"
results=$(cat results.log)
echo '::set-output name=results::"$results"'
env:
KEY: ${{ steps.run-benchmarks.outputs.object-key }}
- name: View context attributes
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
console.log("This is body:", process.env.BODY)
console.log(context)
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '👋 Thanks for reporting!'
})
env:
BODY: ${{ steps.get-results.outputs.results }}