Skip to content

Commit bec0f4b

Browse files
committed
cope with change from stackhpc terraform-> tofu directory
1 parent 85eafcc commit bec0f4b

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.github/workflows/stackhpc.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,17 @@ jobs:
4848
- name: Find the latest release
4949
run: |
5050
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
5251
5352
- name: Checkout latest release
5453
uses: actions/checkout@v4
5554
with:
5655
ref: ${{ env.LATEST_RELEASE_TAG }}
5756

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+
5862
- name: Override CI_CLOUD if PR label is present
5963
if: ${{ github.event_name == 'pull_request' }}
6064
run: |
@@ -69,9 +73,11 @@ jobs:
6973
fi
7074
done
7175
72-
- name: Record settings for CI cloud
76+
- name: Record debug info
7377
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
7581
7682
- name: Setup ssh
7783
run: |
@@ -95,7 +101,7 @@ jobs:
95101

96102
- name: Initialise tofu
97103
run: tofu init
98-
working-directory: ${{ github.workspace }}/environments/.stackhpc/tofu
104+
working-directory: ${{ env.STACKHPC_TF_DIR }}
99105

100106
- name: Write clouds.yaml
101107
run: |
@@ -117,14 +123,14 @@ jobs:
117123
run: |
118124
. venv/bin/activate
119125
. environments/.stackhpc/activate
120-
cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
126+
cd $STACKHPC_TF_DIR
121127
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
122128
123129
- name: Delete infrastructure if provisioning failed
124130
run: |
125131
. venv/bin/activate
126132
. environments/.stackhpc/activate
127-
cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
133+
cd $STACKHPC_TF_DIR
128134
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
129135
if: failure() && steps.provision_servers.outcome == 'failure'
130136

@@ -182,12 +188,17 @@ jobs:
182188
- name: Checkout current branch
183189
uses: actions/checkout@v4
184190

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+
185196
- name: Reimage login and control nodes to image in current branch
186197
id: reimage_non_compute
187198
run: |
188199
. venv/bin/activate
189200
. environments/.stackhpc/activate
190-
cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
201+
cd $STACKHPC_TF_DIR
191202
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars" -var-file=cluster_image.latest.tfvars.json
192203
193204
- name: Configure cluster using current branch
@@ -227,6 +238,6 @@ jobs:
227238
run: |
228239
. venv/bin/activate
229240
. environments/.stackhpc/activate
230-
cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
241+
cd $STACKHPC_TF_DIR
231242
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
232243
if: ${{ success() || cancelled() }}

0 commit comments

Comments
 (0)