43
43
TF_VAR_cluster_name : slurmci-${{ matrix.os_version }}-${{ github.run_number }}
44
44
CI_CLOUD : ${{ vars.CI_CLOUD }} # default from repo settings
45
45
TF_VAR_os_version : ${{ matrix.os_version }}
46
- # Once a v1.158 is released including https://github.com/stackhpc/ansible-slurm-appliance/pull/541
47
- # this can be simplified:
48
- STACKHPC_TF_DIR_OLD : environments/.stackhpc/terraform/ # v1.158
49
- STACKHPC_TF_DIR_NEW : environments/.stackhpc/tofu/
46
+ STACKHPC_TF_DIR : environemnts/.stackhpc/tofu
50
47
steps :
51
48
52
49
- name : Find the latest release
100
97
101
98
- name : Initialise tofu
102
99
run : tofu init
103
- working-directory : ${{ env.STACKHPC_TF_DIR_OLD }}
100
+ working-directory : ${{ env.STACKHPC_TF_DIR }}
104
101
105
102
- name : Write clouds.yaml
106
103
run : |
@@ -122,14 +119,14 @@ jobs:
122
119
run : |
123
120
. venv/bin/activate
124
121
. environments/.stackhpc/activate
125
- cd $STACKHPC_TF_DIR_OLD
122
+ cd $STACKHPC_TF_DIR
126
123
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
127
124
128
125
- name : Delete infrastructure if provisioning failed
129
126
run : |
130
127
. venv/bin/activate
131
128
. environments/.stackhpc/activate
132
- cd $STACKHPC_TF_DIR_OLD
129
+ cd $STACKHPC_TF_DIR
133
130
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
134
131
if : failure() && steps.provision_servers.outcome == 'failure'
135
132
@@ -195,8 +192,7 @@ jobs:
195
192
run : |
196
193
. venv/bin/activate
197
194
. environments/.stackhpc/activate
198
- cp $STACKHPC_TF_DIR_OLD/terraform.tfstate $STACKHPC_TF_DIR_NEW
199
- cd $STACKHPC_TF_DIR_NEW
195
+ cd $STACKHPC_TF_DIR
200
196
tofu init
201
197
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
202
198
@@ -237,9 +233,6 @@ jobs:
237
233
run : |
238
234
. venv/bin/activate
239
235
. environments/.stackhpc/activate
240
- cd $STACKHPC_TF_DIR_OLD
241
- tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars" || echo "tofu failed in $STACKHPC_TF_DIR_OLD"
242
- cd -
243
- cd $STACKHPC_TF_DIR_NEW
244
- tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars" || echo "tofu failed in $STACKHPC_TF_DIR_NEW"
236
+ cd $STACKHPC_TF_DIR
237
+ tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars" || echo "tofu failed in $STACKHPC_TF_DIR"
245
238
if : ${{ success() || cancelled() }}
0 commit comments