-
Notifications
You must be signed in to change notification settings - Fork 426
59 lines (56 loc) · 1.79 KB
/
data_tasks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Run various tasks, usually related to the report aggregations
name: Data tasks
on:
workflow_dispatch:
inputs:
Task:
type: choice
description: "The data task to perform"
required: true
options:
- "report/refresh"
- "report/fast_recreate"
- "report/create_from_scratch"
Environment:
type: choice
description: "The environment to target"
required: true
default: 'staging'
options:
- 'staging'
- 'prod'
Region:
type: choice
description: "The AWS region to target"
required: true
default: 'all'
options:
- 'all'
- 'ca-central-1'
- 'us-west-1'
Destructive:
description: Check to confirm you are happy to proceed with a destructive operation
type: boolean
required: false
default: false
jobs:
check_for_danger:
runs-on: ubuntu-latest
name: "Check for approval for dangerous actions"
steps:
- name: "Approval not given!"
if: contains(fromJson('["report/fast_recreate", "report/create_from_scratch"]'), inputs.Task) && inputs.Destructive == false
run: |
echo "::error::'${{ inputs.Task }}' needs destructive option"
exit 1
run_task:
needs: check_for_danger
name: "Run '${{ inputs.Task }}' data task in ${{ inputs.Environment }} / ${{ inputs.Region }}"
uses: hypothesis/workflows/.github/workflows/eb-task.yml@main
with:
App: ${{ github.event.repository.name }}
Env: ${{ inputs.Environment }}
Timeout: 7200
Region: ${{ inputs.Region }}
Command: 'newrelic-admin run-program python bin/run_data_task.py --config-file conf/production.ini --task ${{ inputs.Task }}'
secrets: inherit