From e98f06255616cc24b082c02ac23596f2b34557ac Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Tue, 30 Jul 2024 16:57:03 +1000 Subject: [PATCH] deploy-1-setup: Updated jq to new settings.json format --- .github/workflows/deploy-1-setup.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-1-setup.yml b/.github/workflows/deploy-1-setup.yml index 70e9f80..e4458c3 100644 --- a/.github/workflows/deploy-1-setup.yml +++ b/.github/workflows/deploy-1-setup.yml @@ -19,7 +19,8 @@ on: type: string required: true description: The root SBD that is being used as the modulefile name - +env: + CONFIG_SETTINGS_PATH: ./config/settings.json jobs: setup-spack-env: name: Setup Spack Environment @@ -56,9 +57,11 @@ jobs: id: get-deployment-environment run: | if [[ "${{ inputs.type }}" == "release" ]]; then - echo "deployment-environments=$(jq --compact-output '.environments' ./config/deployment-environment.json)" >> $GITHUB_OUTPUT + # Convention is to just have the name by itself for release (eg. 'Gadi') + echo "deployment-environments=$(jq --compact-output '.deployment | keys' ${{ env.CONFIG_SETTINGS_PATH }})" >> $GITHUB_OUTPUT elif [[ "${{ inputs.type }}" == "prerelease" ]]; then - echo "deployment-environments=$(jq --compact-output '."prerelease-environments"' ./config/deployment-environment.json)" >> $GITHUB_OUTPUT + # Convention is to have the name + Prerelease (eg. 'Gadi Prerelease') + echo "deployment-environments=$(jq --compact-output '[.deployment | keys | "\(.[]) Prerelease"]' ${{ env.CONFIG_SETTINGS_PATH }})" >> $GITHUB_OUTPUT else echo "::error::The 'type' input was invalid. Check the inputs documentation." exit 1