/.github/{scripts,workflows}: complete workflow on successful job creation

This commit is contained in:
Dustin Brown
2021-02-17 12:24:46 -08:00
parent 798ba606d8
commit 3eda0223cd
2 changed files with 24 additions and 34 deletions

View File

@@ -54,14 +54,4 @@ source "$TEMPLATE_SCRIPT" "$jobname" "$FROM_VERSION" "$TO_VERSION" "$timeprefix"
KUBECONFIG="$KUBECONFIG" kubectl apply -f job.json
out=$(KUBECONFIG="$KUBECONFIG" kubectl wait job/"$jobname" --for=condition=complete -n sql-correctness --timeout=7200s || true)
if [ "$out" != "job.batch/$jobname condition met" ]; then
echo "output of kubectl wait: $out"
KUBECONFIG="$KUBECONFIG" kubectl logs job/"$jobname" -n sql-correctness
else
echo "::set-output name=object-key::$timeprefix/$actorprefix/correctness-results.log"
KUBECONFIG="$KUBECONFIG" kubectl delete job/"$jobname" -n sql-correctness
fi
exit 0

View File

@@ -64,27 +64,27 @@ jobs:
ACTOR: ${{ needs.set-version-actor.outputs.actor }}
KUBECONFIG: "./kubeconfig"
TEMPLATE_SCRIPT: "./.github/scripts/sql-correctness/get-dolt-correctness-job-json.sh"
- name: Get correctness results
id: get-results
run: |
aws s3api get-object --bucket=sql-correctness-github-actions-results --key="$KEY" results.log
env:
KEY: ${{ steps.run-correctness.outputs.object-key }}
- name: Send Email on Release
if: ${{ github.event_name == 'repository_dispatch' }}
uses: ./.github/actions/ses-email-action
with:
region: us-west-2
version: ${{ needs.set-version-actor.outputs.version }}
template: 'SqlCorrectnessReleaseTemplate'
toAddresses: '["${{ secrets.PERF_REPORTS_EMAIL_ADDRESS }}"]'
dataFile: ${{ format('{0}/results.log', github.workspace) }}
- name: Send Email
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/ses-email-action
with:
region: us-west-2
version: ${{ needs.set-version-actor.outputs.version }}
template: 'SqlCorrectnessReleaseTemplate'
toAddresses: '["${{ github.event.inputs.email }}"]'
dataFile: ${{ format('{0}/results.log', github.workspace) }}
# - name: Get correctness results
# id: get-results
# run: |
# aws s3api get-object --bucket=sql-correctness-github-actions-results --key="$KEY" results.log
# env:
# KEY: ${{ steps.run-correctness.outputs.object-key }}
# - name: Send Email on Release
# if: ${{ github.event_name == 'repository_dispatch' }}
# uses: ./.github/actions/ses-email-action
# with:
# region: us-west-2
# version: ${{ needs.set-version-actor.outputs.version }}
# template: 'SqlCorrectnessReleaseTemplate'
# toAddresses: '["${{ secrets.PERF_REPORTS_EMAIL_ADDRESS }}"]'
# dataFile: ${{ format('{0}/results.log', github.workspace) }}
# - name: Send Email
# if: ${{ github.event_name == 'workflow_dispatch' }}
# uses: ./.github/actions/ses-email-action
# with:
# region: us-west-2
# version: ${{ needs.set-version-actor.outputs.version }}
# template: 'SqlCorrectnessReleaseTemplate'
# toAddresses: '["${{ github.event.inputs.email }}"]'
# dataFile: ${{ format('{0}/results.log', github.workspace) }}