forked from aztfmod/terraform-azurerm-caf
-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (79 loc) · 2.72 KB
/
phases_destroy.yaml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: phases_dispatcher_destroy
on:
workflow_call:
inputs:
matrix:
required: true
type: string
jobs:
setup_destroy:
name: setup phases
runs-on: ubuntu-latest
outputs:
name: ${{ steps.setup_destroy.outputs.name }}
phase1: ${{ steps.setup_destroy.outputs.phase1 }}
phase2: ${{ steps.setup_destroy.outputs.phase2 }}
phase3: ${{ steps.setup_destroy.outputs.phase3 }}
lz_ref: ${{ steps.setup_destroy.outputs.lz_ref }}
steps:
- name: set outputs with default values
id: setup_destroy
run: |
echo '${{inputs.matrix}}' | jq -c
#
name=$(echo '${{inputs.matrix}}' | jq -c .name) && echo "name: $name"
phase1=$(echo '${{inputs.matrix}}' | jq -c .phase1) && echo "phase1: $phase1"
phase2=$(echo '${{inputs.matrix}}' | jq -c .phase2) && echo "phase2: $phase2"
phase3=$(echo '${{inputs.matrix}}' | jq -c .phase3) && echo "phase3: $phase3"
lz_ref=$(echo '${{inputs.matrix}}' | jq -c .lz_ref) && echo "lz_ref: $lz_ref"
#
echo "name=$name" >> $GITHUB_OUTPUT
echo "phase1=$phase1" >> $GITHUB_OUTPUT
echo "phase2=$phase2" >> $GITHUB_OUTPUT
echo "phase3=$phase3" >> $GITHUB_OUTPUT
echo "lz_ref=$lz_ref" >> $GITHUB_OUTPUT
phase3_destroy:
needs: [setup_destroy]
strategy:
max-parallel: 20
fail-fast: false
matrix:
phase: ${{ fromJSON(needs.setup_destroy.outputs.phase3) }}
uses: ./.github/workflows/rover.yaml
secrets: inherit
with:
scenario: ${{ needs.setup_destroy.outputs.name }}
name: phase3
phase: ${{ toJSON(matrix.phase) }}
lz_ref: ${{ fromJSON(needs.setup_destroy.outputs.lz_ref) }}
plan_options: -destroy
phase2_destroy:
needs: [setup_destroy, phase3_destroy]
strategy:
max-parallel: 20
fail-fast: false
matrix:
phase: ${{ fromJSON(needs.setup_destroy.outputs.phase2) }}
uses: ./.github/workflows/rover.yaml
secrets: inherit
with:
scenario: ${{ needs.setup_destroy.outputs.name }}
name: phase2
phase: ${{ toJSON(matrix.phase) }}
lz_ref: ${{ fromJSON(needs.setup_destroy.outputs.lz_ref) }}
plan_options: -destroy
phase1_destroy:
needs: [setup_destroy, phase2_destroy]
strategy:
max-parallel: 20
fail-fast: false
matrix:
phase: ${{ fromJSON(needs.setup_destroy.outputs.phase1) }}
uses: ./.github/workflows/rover.yaml
secrets: inherit
with:
scenario: ${{ needs.setup_destroy.outputs.name }}
name: phase1
phase: ${{ toJSON(matrix.phase) }}
lz_ref: ${{ fromJSON(needs.setup_destroy.outputs.lz_ref) }}
plan_options: -destroy