Skip to content

Commit e140948

Browse files
committed
fix STACKHPC_TF_DIR being concatenated not overwritten in GITHUB_ENV
1 parent cfc14a3 commit e140948

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

.github/workflows/stackhpc.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ jobs:
5555
ref: ${{ env.LATEST_RELEASE_TAG }}
5656
fetch-depth: 0
5757

58-
- name: Find stackhpc tofu/terraform directory
58+
- name: Find stackhpc tofu/terraform directory at latest release
5959
# changed in https://github.com/stackhpc/ansible-slurm-appliance/pull/541
6060
run: |
61-
echo STACKHPC_TF_DIR=$(find environments/.stackhpc/ -type d \( -name tofu -o -name terraform \)) >> "$GITHUB_ENV"
61+
echo STACKHPC_TF_DIR_RELEASE=$(find environments/.stackhpc/ -type d \( -name tofu -o -name terraform \)) >> "$GITHUB_ENV"
6262
6363
- name: Override CI_CLOUD if PR label is present
6464
if: ${{ github.event_name == 'pull_request' }}
@@ -77,7 +77,7 @@ jobs:
7777
- name: Record debug info
7878
run: |
7979
echo LATEST_RELEASE_TAG: $LATEST_RELEASE_TAG
80-
echo STACKHPC_TF_DIR: $STACKHPC_TF_DIR
80+
echo STACKHPC_TF_DIR_RELEASE: $STACKHPC_TF_DIR_RELEASE
8181
echo CI_CLOUD: $CI_CLOUD
8282
8383
- name: Setup ssh
@@ -102,7 +102,7 @@ jobs:
102102

103103
- name: Initialise tofu
104104
run: tofu init
105-
working-directory: ${{ env.STACKHPC_TF_DIR }}
105+
working-directory: ${{ env.STACKHPC_TF_DIR_RELEASE }}
106106

107107
- name: Write clouds.yaml
108108
run: |
@@ -124,14 +124,14 @@ jobs:
124124
run: |
125125
. venv/bin/activate
126126
. environments/.stackhpc/activate
127-
cd $STACKHPC_TF_DIR
127+
cd $STACKHPC_TF_DIR_RELEASE
128128
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
129129
130130
- name: Delete infrastructure if provisioning failed
131131
run: |
132132
. venv/bin/activate
133133
. environments/.stackhpc/activate
134-
cd $STACKHPC_TF_DIR
134+
cd $STACKHPC_TF_DIR_RELEASE
135135
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
136136
if: failure() && steps.provision_servers.outcome == 'failure'
137137

@@ -192,17 +192,18 @@ jobs:
192192
- name: Update ansible, pip and galaxy requirements
193193
run: dev/setup-env.sh
194194

195-
- name: Find stackhpc tofu/terraform directory
195+
- name: Find stackhpc tofu/terraform directory in current branch
196196
# changed in https://github.com/stackhpc/ansible-slurm-appliance/pull/541
197197
run: |
198-
echo STACKHPC_TF_DIR=$(find environments/.stackhpc/ -type d \( -name tofu -o -name terraform \)) >> "$GITHUB_ENV"
198+
echo STACKHPC_TF_DIR_BRANCH=$(find environments/.stackhpc/ -type d \( -name tofu -o -name terraform \)) >> "$GITHUB_ENV"
199199
200200
- name: Reimage login and control nodes to image in current branch
201201
id: reimage_non_compute
202202
run: |
203+
echo STACKHPC_TF_DIR_BRANCH: $STACKHPC_TF_DIR_BRANCH
203204
. venv/bin/activate
204205
. environments/.stackhpc/activate
205-
cd $STACKHPC_TF_DIR
206+
cd $STACKHPC_TF_DIR_BRANCH
206207
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
207208
208209
- name: Configure cluster using current branch
@@ -242,6 +243,6 @@ jobs:
242243
run: |
243244
. venv/bin/activate
244245
. environments/.stackhpc/activate
245-
cd $STACKHPC_TF_DIR
246+
cd $STACKHPC_TF_DIR_BRANCH
246247
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
247248
if: ${{ success() || cancelled() }}

0 commit comments

Comments
 (0)