@@ -48,13 +48,17 @@ jobs:
48
48
- name : Find the latest release
49
49
run : |
50
50
echo LATEST_RELEASE_TAG=$(curl -s https://api.github.com/repos/stackhpc/ansible-slurm-appliance/releases/latest | jq -r .tag_name) >> "$GITHUB_ENV"
51
- echo LATEST_RELEASE_TAG: $LATEST_RELEASE_TAG
52
51
53
52
- name : Checkout latest release
54
53
uses : actions/checkout@v4
55
54
with :
56
55
ref : ${{ env.LATEST_RELEASE_TAG }}
57
56
57
+ - name : Find stackhpc tofu/terraform directory
58
+ # changed in https://github.com/stackhpc/ansible-slurm-appliance/pull/541
59
+ run : |
60
+ echo STACKHPC_TF_DIR=$(find environments/.stackhpc/ -type d \( -name terraform -o -name tofu )) >> "$GITHUB_ENV"
61
+
58
62
- name : Override CI_CLOUD if PR label is present
59
63
if : ${{ github.event_name == 'pull_request' }}
60
64
run : |
69
73
fi
70
74
done
71
75
72
- - name : Record settings for CI cloud
76
+ - name : Record debug info
73
77
run : |
74
- echo CI_CLOUD: ${{ env.CI_CLOUD }}
78
+ echo LATEST_RELEASE_TAG: $LATEST_RELEASE_TAG
79
+ echo STACKHPC_TF_DIR: $STACKHPC_TF_DIR
80
+ echo CI_CLOUD: $CI_CLOUD
75
81
76
82
- name : Setup ssh
77
83
run : |
95
101
96
102
- name : Initialise tofu
97
103
run : tofu init
98
- working-directory : ${{ github.workspace }}/environments/.stackhpc/tofu
104
+ working-directory : ${{ env.STACKHPC_TF_DIR }}
99
105
100
106
- name : Write clouds.yaml
101
107
run : |
@@ -117,14 +123,14 @@ jobs:
117
123
run : |
118
124
. venv/bin/activate
119
125
. environments/.stackhpc/activate
120
- cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
126
+ cd $STACKHPC_TF_DIR
121
127
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
122
128
123
129
- name : Delete infrastructure if provisioning failed
124
130
run : |
125
131
. venv/bin/activate
126
132
. environments/.stackhpc/activate
127
- cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
133
+ cd $STACKHPC_TF_DIR
128
134
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
129
135
if : failure() && steps.provision_servers.outcome == 'failure'
130
136
@@ -182,12 +188,17 @@ jobs:
182
188
- name : Checkout current branch
183
189
uses : actions/checkout@v4
184
190
191
+ - name : Find stackhpc tofu/terraform directory
192
+ # changed in https://github.com/stackhpc/ansible-slurm-appliance/pull/541
193
+ run : |
194
+ echo STACKHPC_TF_DIR=$(find environments/.stackhpc/ -type d \( -name terraform -o -name tofu )) >> "$GITHUB_ENV"
195
+
185
196
- name : Reimage login and control nodes to image in current branch
186
197
id : reimage_non_compute
187
198
run : |
188
199
. venv/bin/activate
189
200
. environments/.stackhpc/activate
190
- cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
201
+ cd $STACKHPC_TF_DIR
191
202
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars" -var-file=cluster_image.latest.tfvars.json
192
203
193
204
- name : Configure cluster using current branch
@@ -227,6 +238,6 @@ jobs:
227
238
run : |
228
239
. venv/bin/activate
229
240
. environments/.stackhpc/activate
230
- cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
241
+ cd $STACKHPC_TF_DIR
231
242
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
232
243
if : ${{ success() || cancelled() }}
0 commit comments