From 2afe813f7742a506a481cb55a4306e052cfdbd53 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Tue, 4 Feb 2025 09:48:25 +0000 Subject: [PATCH 01/27] refactor: replace hardcoded script call with variable for command execution --- .github/actions/devcontainer_run_command/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index 8a20244..f534b30 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -250,7 +250,7 @@ runs: -e TF_VAR_firewall_sku=${{ inputs.FIREWALL_SKU }} \ -e E2E_TESTS_NUMBER_PROCESSES="${{ inputs.E2E_TESTS_NUMBER_PROCESSES }}" \ '${{ inputs.CI_CACHE_ACR_NAME }}${{ env.ACR_DOMAIN_SUFFIX }}/tredev:${{ inputs.DEVCONTAINER_TAG }}' \ - bash -c "./command.sh" + bash -c "${SCRIPT_FILE}" # Clean up temporary script file rm "${SCRIPT_FILE}" From 79daf00f1bcfc75b5cbd71cd2e901ca477ad03bf Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Tue, 4 Feb 2025 10:26:21 +0000 Subject: [PATCH 02/27] fix: update command execution to use a temporary script file --- .github/actions/devcontainer_run_command/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index f534b30..9d99048 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -186,6 +186,7 @@ runs: docker run --rm --mount \ "type=bind,src=${{ github.workspace }},dst=/workspaces/tre" \ -v /var/run/docker.sock:/var/run/docker.sock \ + -v "${SCRIPT_FILE}:./command.sh" \ --workdir /workspaces/tre \ --user vscode \ -e TF_INPUT="0" \ @@ -250,7 +251,7 @@ runs: -e TF_VAR_firewall_sku=${{ inputs.FIREWALL_SKU }} \ -e E2E_TESTS_NUMBER_PROCESSES="${{ inputs.E2E_TESTS_NUMBER_PROCESSES }}" \ '${{ inputs.CI_CACHE_ACR_NAME }}${{ env.ACR_DOMAIN_SUFFIX }}/tredev:${{ inputs.DEVCONTAINER_TAG }}' \ - bash -c "${SCRIPT_FILE}" + bash -c "./command.sh" # Clean up temporary script file rm "${SCRIPT_FILE}" From de04e237d0b6c49bb65e9927ab4123258de5b943 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Tue, 4 Feb 2025 11:51:49 +0000 Subject: [PATCH 03/27] fix: update volume mount path for command script in devcontainer action --- .github/actions/devcontainer_run_command/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index 9d99048..4f9eef1 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -186,7 +186,7 @@ runs: docker run --rm --mount \ "type=bind,src=${{ github.workspace }},dst=/workspaces/tre" \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v "${SCRIPT_FILE}:./command.sh" \ + -v "${SCRIPT_FILE}:/workspaces/tre/command.sh" \ --workdir /workspaces/tre \ --user vscode \ -e TF_INPUT="0" \ From c383f54024338acd12c1dc768d677ed3588c72da Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Wed, 5 Feb 2025 14:51:56 +0000 Subject: [PATCH 04/27] refactor multilines commands in devcontainer --- .github/workflows/deploy_tre_reusable.yml | 45 ++++++++++++++++++----- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index 4763b89..221c6a1 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -415,8 +415,13 @@ jobs: with: # Although porter publish will build automatically, our makefile build target includes logic that should run COMMAND: | - for i in {1..3}; do make bundle-build bundle-publish DIR=${{ matrix.BUNDLE_DIR }} - && ec=0 && break || ec=\$? && sleep 30; done; (exit \$ec) + # Loop to retry the make command up to 3 times + for i in {1..3}; do + make bundle-build bundle-publish DIR=${{ matrix.BUNDLE_DIR }} && ec=0 && break || ec=\$? && sleep 30; + done; + + # Exit with the last status code + (exit \$ec) DEVCONTAINER_TAG: ${{ inputs.DEVCONTAINER_TAG }} AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} AZURE_ENVIRONMENT: ${{ vars.AZURE_ENVIRONMENT }} @@ -461,8 +466,13 @@ jobs: with: # Although porter publish will build automatically, our makefile build target includes logic that should run COMMAND: | - for i in {1..3}; do make bundle-build bundle-publish DIR=${{ matrix.BUNDLE_DIR }} - && ec=0 && break || ec=\$? && sleep 30; done; (exit \$ec) + # Loop to retry the make command up to 3 times + for i in {1..3}; do + make bundle-build bundle-publish DIR=${{ matrix.BUNDLE_DIR }} && ec=0 && break || ec=\$? && sleep 30; + done + + # Exit with the last status code + (exit \$ec) DEVCONTAINER_TAG: ${{ inputs.DEVCONTAINER_TAG }} AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} AZURE_ENVIRONMENT: ${{ vars.AZURE_ENVIRONMENT }} @@ -505,8 +515,13 @@ jobs: uses: ./.github/actions/devcontainer_run_command with: COMMAND: | - for i in {1..3}; do make bundle-register DIR=${{ matrix.BUNDLE_DIR }} - && ec=0 && break || ec=\$? && sleep 10; done; (exit \$ec) + # Loop to retry the make command up to 3 times + for i in {1..3}; do + make bundle-register DIR=${{ matrix.BUNDLE_DIR }} && ec=0 && break || ec=\$? && sleep 10; + done + + # Exit with the last status code + (exit \$ec) DEVCONTAINER_TAG: ${{ inputs.DEVCONTAINER_TAG }} CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}} AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} @@ -567,8 +582,13 @@ jobs: uses: ./.github/actions/devcontainer_run_command with: COMMAND: | - for i in {1..3}; do make bundle-register DIR=${{ matrix.BUNDLE_DIR }} - && ec=0 && break || ec=\$? && sleep 10; done; (exit \$ec) + # Loop to retry the make command up to 3 times + for i in {1..3}; do + make bundle-register DIR=${{ matrix.BUNDLE_DIR }} && ec=0 && break || ec=\$? && sleep 10; + done; + + # Exit with the last status code + (exit \$ec) DEVCONTAINER_TAG: ${{ inputs.DEVCONTAINER_TAG }} CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}} AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} @@ -617,8 +637,13 @@ jobs: uses: ./.github/actions/devcontainer_run_command with: COMMAND: | - for i in {1..3}; do make bundle-register DIR=${{ matrix.BUNDLE_DIR }} - && ec=0 && break || ec=\$? && sleep 10; done; (exit \$ec) + # Loop to retry the make command up to 3 times + for i in {1..3}; do + make bundle-register DIR=${{ matrix.BUNDLE_DIR }} && ec=0 && break || ec=\$? && sleep 10; + done; + + # Exit with the last status code + (exit \$ec) DEVCONTAINER_TAG: ${{ inputs.DEVCONTAINER_TAG }} CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}} AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} From 4648c258b8e4258416fdfc51d47662ed994c89e3 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 10:43:06 +0000 Subject: [PATCH 05/27] fix: update script file handling in devcontainer action to use command.sh instead of temp file --- .github/actions/devcontainer_run_command/action.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index 4f9eef1..ceefe9e 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -174,13 +174,9 @@ runs: - name: Run command in DevContainer shell: bash run: | - # Write command to a temporary script file with lowercase name - SCRIPT_FILE=$(mktemp) - mv "${SCRIPT_FILE}" "${SCRIPT_FILE,,}" - SCRIPT_FILE="${SCRIPT_FILE,,}" - cat << 'EOF' > "${SCRIPT_FILE}" - ${{ inputs.COMMAND }} - EOF + # Write command to a command.sh script file + SCRIPT_FILE="/workspaces/tre/command.sh" + echo "${{ inputs.COMMAND }}" > "${SCRIPT_FILE}" chmod +x "${SCRIPT_FILE}" docker run --rm --mount \ From c333d375dadbbbaf956e35c2b4540f11fe166ecc Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 10:51:28 +0000 Subject: [PATCH 06/27] feat: add Terraform setup step in build validation workflow --- .github/workflows/build_validation_develop.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build_validation_develop.yml b/.github/workflows/build_validation_develop.yml index c5e7195..c4c8306 100644 --- a/.github/workflows/build_validation_develop.yml +++ b/.github/workflows/build_validation_develop.yml @@ -26,6 +26,11 @@ jobs: fetch-depth: 0 persist-credentials: false + - name: Set up Terraform + uses: hashicorp/setup-terraform@v1 + with: + terraform_version: 1.4.5 + - name: Terraform format check run: terraform fmt -check -recursive From 05741b8a29f0527d916070d85355118f9e0bf9cd Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 11:09:10 +0000 Subject: [PATCH 07/27] fix: remove unused prRef input from register_tre_bundle workflow --- .github/workflows/register_tre_bundle.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index 3c9cb58..2d96779 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -29,10 +29,6 @@ on: description: The name of the workspace service to register user resources for type: string required: false - prRef: - description: The git ref to checkout - type: string - required: false jobs: deploy_management: @@ -50,7 +46,6 @@ jobs: echo "prRHeadSha : ${{ github.sha }}" echo "ciGitRef : ${{ github.ref }}" echo "environment : ${{ inputs.environmentName || 'CICD'}}" - echo "prRef : ${{ inputs.prRef }}" echo AAD_TENANT_ID: ${{ secrets.AAD_TENANT_ID }} echo ACR_NAME: ${{ secrets.ACR_NAME }} echo API_CLIENT_ID: ${{ secrets.API_CLIENT_ID }} @@ -176,7 +171,7 @@ jobs: AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} AZURE_ENVIRONMENT: ${{ vars.AZURE_ENVIRONMENT }} TRE_ID: ${{ secrets.TRE_ID }} - LOCATION: "uksouth" + LOCATION: ${{ vars.LOCATION }} ACR_NAME: ${{ secrets.ACR_NAME }} TERRAFORM_STATE_CONTAINER_NAME: ${{ vars.TERRAFORM_STATE_CONTAINER_NAME }} MGMT_RESOURCE_GROUP_NAME: ${{ secrets.MGMT_RESOURCE_GROUP_NAME }} From 4c3784d3a53baff5796ee20826a20377af82f08c Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 11:12:04 +0000 Subject: [PATCH 08/27] fix: update ref input in register_tre_bundle workflow to use github.ref --- .github/workflows/register_tre_bundle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index 2d96779..2877ec0 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -121,7 +121,7 @@ jobs: persist-credentials: false # if the following values are missing (i.e. not triggered via comment workflow) # then the default checkout will apply - ref: ${{ inputs.prRef }} + ref: ${{ github.ref }} - name: Set up Docker BuildKit uses: docker/setup-buildx-action@v3 From 5f0b31279e001b39069da41565ebe2313acea721 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 11:24:47 +0000 Subject: [PATCH 09/27] fix: update devcontainer action to use relative path for command.sh script --- .github/actions/devcontainer_run_command/action.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index ceefe9e..469533a 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -175,14 +175,13 @@ runs: shell: bash run: | # Write command to a command.sh script file - SCRIPT_FILE="/workspaces/tre/command.sh" - echo "${{ inputs.COMMAND }}" > "${SCRIPT_FILE}" - chmod +x "${SCRIPT_FILE}" + echo "${{ inputs.COMMAND }}" > ./command.sh + chmod +x ./command.sh docker run --rm --mount \ "type=bind,src=${{ github.workspace }},dst=/workspaces/tre" \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v "${SCRIPT_FILE}:/workspaces/tre/command.sh" \ + -v "./command.sh:/workspaces/tre/command.sh" \ --workdir /workspaces/tre \ --user vscode \ -e TF_INPUT="0" \ @@ -250,4 +249,4 @@ runs: bash -c "./command.sh" # Clean up temporary script file - rm "${SCRIPT_FILE}" + rm ./command.sh From 5480dc7c706d339b9285c4885b09134687c42fb1 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 11:36:04 +0000 Subject: [PATCH 10/27] fix: add shebang and debug option to command.sh script in devcontainer action --- .github/actions/devcontainer_run_command/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index 469533a..830e56d 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -175,6 +175,8 @@ runs: shell: bash run: | # Write command to a command.sh script file + echo "#!/bin/bash" > ./command.sh + echo "set -x" >> ./command.sh echo "${{ inputs.COMMAND }}" > ./command.sh chmod +x ./command.sh From d2f8a81fea7b3dba5e8a9de4ba6a0756be9f48d5 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 11:58:04 +0000 Subject: [PATCH 11/27] fix: enable debug mode in command.sh execution and update conditional checks in register_tre_bundle workflow --- .github/actions/devcontainer_run_command/action.yml | 2 +- .github/workflows/register_tre_bundle.yml | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index 830e56d..c0500ac 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -248,7 +248,7 @@ runs: -e TF_VAR_firewall_sku=${{ inputs.FIREWALL_SKU }} \ -e E2E_TESTS_NUMBER_PROCESSES="${{ inputs.E2E_TESTS_NUMBER_PROCESSES }}" \ '${{ inputs.CI_CACHE_ACR_NAME }}${{ env.ACR_DOMAIN_SUFFIX }}/tredev:${{ inputs.DEVCONTAINER_TAG }}' \ - bash -c "./command.sh" + bash -c -x "./command.sh" # Clean up temporary script file rm ./command.sh diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index 2877ec0..8c933e9 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -235,22 +235,26 @@ jobs: bundle_type="${{ inputs.bundle_type }}" workspace_service_name="${{ inputs.workspace_service_name }}" - if [ $bundle_type = "workspace" ]; then + echo "bundle_name: $bundle_name" + echo "bundle_type: $bundle_type" + echo "workspace_service_name: $workspace_service_name" + + if [ $bundle_type == "workspace" ]; then echo "Registering workspace bundle $bundle_name of type $bundle_type" make workspace_bundle BUNDLE="${bundle_name}" fi - if [ $bundle_type = "workspace_service" ]; then + if [ $bundle_type == "workspace_service" ]; then echo "Registering workspace service bundle $bundle_name of type $bundle_type" make workspace_service_bundle BUNDLE="${bundle_name}" WORKSPACE_SERVICE="${workspace_service_name}" fi - if [ $bundle_type = "shared_service" ]; then + if [ $bundle_type == "shared_service" ]; then echo "Registering shared service bundle $bundle_name of type $bundle_type" make shared_service_bundle BUNDLE="${bundle_name}" fi - if [ $bundle_type = "user_resource" ]; then + if [ $bundle_type == "user_resource" ]; then echo "Registering user resource bundle $bundle_name of type $bundle_type into workspace service $workspace_service_name" make user_resource_bundle BUNDLE="${bundle_name}" WORKSPACE_SERVICE="${workspace_service_name}" fi From 4015e1461e102f2483fbfcd94c72b2e209bfbd5f Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 12:13:08 +0000 Subject: [PATCH 12/27] fix: update command.sh script generation to use multiline --- .github/actions/devcontainer_run_command/action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index c0500ac..9140150 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -177,7 +177,10 @@ runs: # Write command to a command.sh script file echo "#!/bin/bash" > ./command.sh echo "set -x" >> ./command.sh - echo "${{ inputs.COMMAND }}" > ./command.sh + cat <> ./command.sh + ${{ inputs.COMMAND }} + EOF + chmod +x ./command.sh docker run --rm --mount \ From 278c801b2c1351a19f54ed4b70b54dfbbc231859 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 13:48:21 +0000 Subject: [PATCH 13/27] test --- .github/workflows/register_tre_bundle.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index 8c933e9..4b5a14b 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -235,6 +235,11 @@ jobs: bundle_type="${{ inputs.bundle_type }}" workspace_service_name="${{ inputs.workspace_service_name }}" + echo "hard code values" + bundle_name="base" + bundle_type="workspace" + workspace_service_name="" + echo "bundle_name: $bundle_name" echo "bundle_type: $bundle_type" echo "workspace_service_name: $workspace_service_name" From 1fb1fa2f68df0f7ba07295e09c76f4f0aded78a6 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 14:25:19 +0000 Subject: [PATCH 14/27] fix: update conditional checks in register_tre_bundle workflow to use single equals for string comparison --- .github/workflows/register_tre_bundle.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index 4b5a14b..586f781 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -244,22 +244,22 @@ jobs: echo "bundle_type: $bundle_type" echo "workspace_service_name: $workspace_service_name" - if [ $bundle_type == "workspace" ]; then + if [ $bundle_type = "workspace" ]; then echo "Registering workspace bundle $bundle_name of type $bundle_type" make workspace_bundle BUNDLE="${bundle_name}" fi - if [ $bundle_type == "workspace_service" ]; then + if [ $bundle_type = "workspace_service" ]; then echo "Registering workspace service bundle $bundle_name of type $bundle_type" make workspace_service_bundle BUNDLE="${bundle_name}" WORKSPACE_SERVICE="${workspace_service_name}" fi - if [ $bundle_type == "shared_service" ]; then + if [ $bundle_type = "shared_service" ]; then echo "Registering shared service bundle $bundle_name of type $bundle_type" make shared_service_bundle BUNDLE="${bundle_name}" fi - if [ $bundle_type == "user_resource" ]; then + if [ $bundle_type = "user_resource" ]; then echo "Registering user resource bundle $bundle_name of type $bundle_type into workspace service $workspace_service_name" make user_resource_bundle BUNDLE="${bundle_name}" WORKSPACE_SERVICE="${workspace_service_name}" fi From e07f845e910d208bb2c847f99918cff70da084d3 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 14:36:29 +0000 Subject: [PATCH 15/27] fix: update conditional checks in register_tre_bundle workflow to use double quotes for string comparison --- .github/workflows/register_tre_bundle.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index 586f781..3c0177b 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -236,30 +236,31 @@ jobs: workspace_service_name="${{ inputs.workspace_service_name }}" echo "hard code values" - bundle_name="base" - bundle_type="workspace" - workspace_service_name="" + export bundle_name=base + export bundle_type=workspace + export workspace_service_name="" + echo "bundle_name: $bundle_name" echo "bundle_type: $bundle_type" echo "workspace_service_name: $workspace_service_name" - if [ $bundle_type = "workspace" ]; then + if [ "$bundle_type" = "workspace" ]; then echo "Registering workspace bundle $bundle_name of type $bundle_type" make workspace_bundle BUNDLE="${bundle_name}" fi - if [ $bundle_type = "workspace_service" ]; then + if [ "$bundle_type" = "workspace_service" ]; then echo "Registering workspace service bundle $bundle_name of type $bundle_type" make workspace_service_bundle BUNDLE="${bundle_name}" WORKSPACE_SERVICE="${workspace_service_name}" fi - if [ $bundle_type = "shared_service" ]; then + if [ "$bundle_type" = "shared_service" ]; then echo "Registering shared service bundle $bundle_name of type $bundle_type" make shared_service_bundle BUNDLE="${bundle_name}" fi - if [ $bundle_type = "user_resource" ]; then + if [ "$bundle_type" = "user_resource" ]; then echo "Registering user resource bundle $bundle_name of type $bundle_type into workspace service $workspace_service_name" make user_resource_bundle BUNDLE="${bundle_name}" WORKSPACE_SERVICE="${workspace_service_name}" fi From 0d4dfda1774e18ec8d6ad14f7f0e360532a39ece Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 15:14:34 +0000 Subject: [PATCH 16/27] fix: update register_tre_bundle workflow to use input variables for bundle registration --- .github/workflows/register_tre_bundle.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index 3c0177b..fa8a49b 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -235,32 +235,26 @@ jobs: bundle_type="${{ inputs.bundle_type }}" workspace_service_name="${{ inputs.workspace_service_name }}" - echo "hard code values" - export bundle_name=base - export bundle_type=workspace - export workspace_service_name="" - - echo "bundle_name: $bundle_name" echo "bundle_type: $bundle_type" echo "workspace_service_name: $workspace_service_name" - if [ "$bundle_type" = "workspace" ]; then + if [ "${{ inputs.bundle_type }}" = "workspace" ]; then echo "Registering workspace bundle $bundle_name of type $bundle_type" - make workspace_bundle BUNDLE="${bundle_name}" + make workspace_bundle BUNDLE="${{ inputs.bundle_name }}" fi - if [ "$bundle_type" = "workspace_service" ]; then + if [ "${{ inputs.bundle_type }}" = "workspace_service" ]; then echo "Registering workspace service bundle $bundle_name of type $bundle_type" make workspace_service_bundle BUNDLE="${bundle_name}" WORKSPACE_SERVICE="${workspace_service_name}" fi - if [ "$bundle_type" = "shared_service" ]; then + if [ "${{ inputs.bundle_type }}" = "shared_service" ]; then echo "Registering shared service bundle $bundle_name of type $bundle_type" make shared_service_bundle BUNDLE="${bundle_name}" fi - if [ "$bundle_type" = "user_resource" ]; then + if [ "${{ inputs.bundle_type }}" = "user_resource" ]; then echo "Registering user resource bundle $bundle_name of type $bundle_type into workspace service $workspace_service_name" make user_resource_bundle BUNDLE="${bundle_name}" WORKSPACE_SERVICE="${workspace_service_name}" fi From ba3b5d50fcd3f4f42a8ced45c70baf8ee0e752a3 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Sun, 9 Feb 2025 15:38:17 +0000 Subject: [PATCH 17/27] fix: update register_tre_bundle workflow to use input variables for bundle parameters --- .github/workflows/register_tre_bundle.yml | 35 +++++++++-------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index fa8a49b..da42943 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -87,21 +87,19 @@ jobs: echo "Missing secret: AZURE_CREDENTIALS" && exit 1 fi - bundle_name="${{ inputs.bundle_name }}" - bundle_type="${{ inputs.bundle_type }}" - workspace_service_name="${{ inputs.workspace_service_name }}" - # if bundle_name is not set, exit with error - if [ -z "${bundle_name}" ]; then + if [ -z "${{ inputs.bundle_name }}" ]; then echo "Missing input: bundle_name" && exit 1 fi - if [ -z "${bundle_type}" ]; then + # if bundle_type is not set, exit with error + if [ -z "${{ inputs.bundle_type }}" ]; then echo "Missing input: bundle_type" && exit 1 fi - if [ $bundle_type = "user_resource" ]; then - if [ -z "${workspace_service_name}" ]; then + # if bundle_type is user_resource, then workspace_service_name is required, if not set, exit with error + if [ "${{ inputs.bundle_type }}" = "user_resource" ]; then + if [ -z "${{ inputs.workspace_service_name }}" ]; then echo "Missing input: workspace_service_name" && exit 1 fi fi @@ -231,32 +229,25 @@ jobs: with: COMMAND: | echo "Starting bundle registration" - bundle_name="${{ inputs.bundle_name }}" - bundle_type="${{ inputs.bundle_type }}" - workspace_service_name="${{ inputs.workspace_service_name }}" - - echo "bundle_name: $bundle_name" - echo "bundle_type: $bundle_type" - echo "workspace_service_name: $workspace_service_name" if [ "${{ inputs.bundle_type }}" = "workspace" ]; then - echo "Registering workspace bundle $bundle_name of type $bundle_type" + echo "Registering workspace bundle ${{ inputs.bundle_name }}" make workspace_bundle BUNDLE="${{ inputs.bundle_name }}" fi if [ "${{ inputs.bundle_type }}" = "workspace_service" ]; then - echo "Registering workspace service bundle $bundle_name of type $bundle_type" - make workspace_service_bundle BUNDLE="${bundle_name}" WORKSPACE_SERVICE="${workspace_service_name}" + echo "Registering workspace service bundle ${{ inputs.bundle_name }}" + make workspace_service_bundle BUNDLE="${{ inputs.bundle_name }}" fi if [ "${{ inputs.bundle_type }}" = "shared_service" ]; then - echo "Registering shared service bundle $bundle_name of type $bundle_type" - make shared_service_bundle BUNDLE="${bundle_name}" + echo "Registering shared service bundle ${{ inputs.bundle_name }}" + make shared_service_bundle BUNDLE="${{ inputs.bundle_name }}" fi if [ "${{ inputs.bundle_type }}" = "user_resource" ]; then - echo "Registering user resource bundle $bundle_name of type $bundle_type into workspace service $workspace_service_name" - make user_resource_bundle BUNDLE="${bundle_name}" WORKSPACE_SERVICE="${workspace_service_name}" + echo "Registering user resource bundle ${{ inputs.bundle_name }} into workspace service ${{ inputs.workspace_service_name }}" + make user_resource_bundle BUNDLE="${{ inputs.bundle_name }}" WORKSPACE_SERVICE="${{ inputs.workspace_service_name }}" fi echo "Finished bundle registration" From 9c90431c41910d707f8cf647e9204d3d87501d55 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Thu, 13 Feb 2025 10:13:57 +0000 Subject: [PATCH 18/27] fix: update devcontainer_run_command action to correctly write command.sh script --- .github/actions/devcontainer_run_command/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index 9140150..bb79528 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -175,9 +175,9 @@ runs: shell: bash run: | # Write command to a command.sh script file - echo "#!/bin/bash" > ./command.sh - echo "set -x" >> ./command.sh - cat <> ./command.sh + cat < ./command.sh + #!/bin/bash + set -x ${{ inputs.COMMAND }} EOF From a740f0b977eb7a6c23a90a267d79cd485ce2dfd0 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Thu, 13 Feb 2025 10:25:23 +0000 Subject: [PATCH 19/27] fix: simplify bundle registration command in workflow --- .github/workflows/register_tre_bundle.yml | 25 +---------------------- 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index da42943..72377c9 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -227,30 +227,7 @@ jobs: - name: Register Bundle uses: ./.github/actions/devcontainer_run_command with: - COMMAND: | - echo "Starting bundle registration" - - if [ "${{ inputs.bundle_type }}" = "workspace" ]; then - echo "Registering workspace bundle ${{ inputs.bundle_name }}" - make workspace_bundle BUNDLE="${{ inputs.bundle_name }}" - fi - - if [ "${{ inputs.bundle_type }}" = "workspace_service" ]; then - echo "Registering workspace service bundle ${{ inputs.bundle_name }}" - make workspace_service_bundle BUNDLE="${{ inputs.bundle_name }}" - fi - - if [ "${{ inputs.bundle_type }}" = "shared_service" ]; then - echo "Registering shared service bundle ${{ inputs.bundle_name }}" - make shared_service_bundle BUNDLE="${{ inputs.bundle_name }}" - fi - - if [ "${{ inputs.bundle_type }}" = "user_resource" ]; then - echo "Registering user resource bundle ${{ inputs.bundle_name }} into workspace service ${{ inputs.workspace_service_name }}" - make user_resource_bundle BUNDLE="${{ inputs.bundle_name }}" WORKSPACE_SERVICE="${{ inputs.workspace_service_name }}" - fi - - echo "Finished bundle registration" + COMMAND: "make bundle BUNDLE=${{ inputs.bundle_name }} BUNDLE_TYPE=${{ inputs.bundle_type }} WORKSPACE_SERVICE=${{ inputs.workspace_service_name }}" DEVCONTAINER_TAG: ${{ needs.prepare-not-main.outputs.refid }} AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} AZURE_ENVIRONMENT: ${{ vars.AZURE_ENVIRONMENT }} From 00b69d15d4253d6bbf8a7e46891491c096ab014c Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Mon, 24 Mar 2025 17:12:04 +0200 Subject: [PATCH 20/27] set 'latest' tag for devcontainer in register_tre_bundle.yml --- .github/workflows/register_tre_bundle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index 77c1df9..8110a01 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -228,7 +228,7 @@ jobs: uses: ./.github/actions/devcontainer_run_command with: COMMAND: "make bundle BUNDLE=${{ inputs.bundle_name }} BUNDLE_TYPE=${{ inputs.bundle_type }} WORKSPACE_SERVICE=${{ inputs.workspace_service_name }}" - DEVCONTAINER_TAG: ${{ needs.prepare-not-main.outputs.refid }} + DEVCONTAINER_TAG: 'latest' AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} AZURE_ENVIRONMENT: ${{ vars.AZURE_ENVIRONMENT }} CI_CACHE_ACR_NAME: ${{ secrets.ACR_NAME}} From afdb9eb5eaef2bb49664343fce3346202788e6ba Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Tue, 25 Mar 2025 15:55:52 +0200 Subject: [PATCH 21/27] Update register_tre_bundle.yml --- .github/workflows/register_tre_bundle.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index 8110a01..a2c2d47 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -237,3 +237,6 @@ jobs: AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}" TRE_ID: ${{ secrets.TRE_ID }} LOCATION: ${{ vars.LOCATION }} + TEST_ACCOUNT_CLIENT_ID: ${{ secrets.TEST_ACCOUNT_CLIENT_ID }} + TEST_ACCOUNT_CLIENT_SECRET: ${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }} + From 21ecfffa76eca058262e5e0b6e4c531827ad9ffb Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Wed, 26 Mar 2025 09:44:19 +0200 Subject: [PATCH 22/27] Update deploy_tre_reusable.yml --- .github/workflows/deploy_tre_reusable.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index c57edff..76e5ef0 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -691,3 +691,6 @@ jobs: MGMT_RESOURCE_GROUP_NAME: ${{ secrets.MGMT_RESOURCE_GROUP_NAME }} MGMT_STORAGE_ACCOUNT_NAME: ${{ secrets.MGMT_STORAGE_ACCOUNT_NAME }} SWAGGER_UI_CLIENT_ID: "${{ secrets.SWAGGER_UI_CLIENT_ID }}" + TEST_ACCOUNT_CLIENT_ID: "${{ TEST_ACCOUNT_CLIENT_ID }}" + TEST_ACCOUNT_CLIENT_SECRET: "${{ TEST_ACCOUNT_CLIENT_SECRET }}" + From 3de46f2af3800f65feae72d5f143cc5309543142 Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Wed, 23 Apr 2025 12:44:51 +0300 Subject: [PATCH 23/27] remove whitespace in deploy_tre_reusable.yml --- .github/workflows/deploy_tre_reusable.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index 4b0be06..095ef90 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -703,4 +703,3 @@ jobs: SWAGGER_UI_CLIENT_ID: "${{ secrets.SWAGGER_UI_CLIENT_ID }}" TEST_ACCOUNT_CLIENT_ID: "${{ TEST_ACCOUNT_CLIENT_ID }}" TEST_ACCOUNT_CLIENT_SECRET: "${{ TEST_ACCOUNT_CLIENT_SECRET }}" - From 317dde8fe8336beed9933e7019a5f1a76c63468f Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Wed, 23 Apr 2025 12:45:43 +0300 Subject: [PATCH 24/27] remove trailing whitespace in register_tre_bundle.yml --- .github/workflows/register_tre_bundle.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index a2c2d47..c40c137 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -239,4 +239,3 @@ jobs: LOCATION: ${{ vars.LOCATION }} TEST_ACCOUNT_CLIENT_ID: ${{ secrets.TEST_ACCOUNT_CLIENT_ID }} TEST_ACCOUNT_CLIENT_SECRET: ${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }} - From c4dc69d1b0c03d50ee2934fc54a0e37afc03c77f Mon Sep 17 00:00:00 2001 From: Guy Bertental Date: Wed, 23 Apr 2025 14:02:40 +0300 Subject: [PATCH 25/27] fix missing secrets keyword --- .github/workflows/deploy_tre_reusable.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index 095ef90..cff0d57 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -701,5 +701,5 @@ jobs: MGMT_RESOURCE_GROUP_NAME: ${{ secrets.MGMT_RESOURCE_GROUP_NAME }} MGMT_STORAGE_ACCOUNT_NAME: ${{ secrets.MGMT_STORAGE_ACCOUNT_NAME }} SWAGGER_UI_CLIENT_ID: "${{ secrets.SWAGGER_UI_CLIENT_ID }}" - TEST_ACCOUNT_CLIENT_ID: "${{ TEST_ACCOUNT_CLIENT_ID }}" - TEST_ACCOUNT_CLIENT_SECRET: "${{ TEST_ACCOUNT_CLIENT_SECRET }}" + TEST_ACCOUNT_CLIENT_ID: "${{ secrets.TEST_ACCOUNT_CLIENT_ID }}" + TEST_ACCOUNT_CLIENT_SECRET: "${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }}" From 147f865e9572b57872ecffc2fb6971535a116f6d Mon Sep 17 00:00:00 2001 From: Marcus Robinson Date: Thu, 5 Jun 2025 20:57:17 +0000 Subject: [PATCH 26/27] Remove uneeded props --- .github/workflows/deploy_tre_reusable.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/deploy_tre_reusable.yml b/.github/workflows/deploy_tre_reusable.yml index cff0d57..85c2ea3 100644 --- a/.github/workflows/deploy_tre_reusable.yml +++ b/.github/workflows/deploy_tre_reusable.yml @@ -701,5 +701,3 @@ jobs: MGMT_RESOURCE_GROUP_NAME: ${{ secrets.MGMT_RESOURCE_GROUP_NAME }} MGMT_STORAGE_ACCOUNT_NAME: ${{ secrets.MGMT_STORAGE_ACCOUNT_NAME }} SWAGGER_UI_CLIENT_ID: "${{ secrets.SWAGGER_UI_CLIENT_ID }}" - TEST_ACCOUNT_CLIENT_ID: "${{ secrets.TEST_ACCOUNT_CLIENT_ID }}" - TEST_ACCOUNT_CLIENT_SECRET: "${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }}" From f255a15b7511dc24dbeded661cd961e06c27176f Mon Sep 17 00:00:00 2001 From: Marcus Robinson Date: Tue, 10 Jun 2025 14:59:29 +0100 Subject: [PATCH 27/27] Remove uneeded paramaters. --- .github/workflows/register_tre_bundle.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index c40c137..8110a01 100644 --- a/.github/workflows/register_tre_bundle.yml +++ b/.github/workflows/register_tre_bundle.yml @@ -237,5 +237,3 @@ jobs: AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}" TRE_ID: ${{ secrets.TRE_ID }} LOCATION: ${{ vars.LOCATION }} - TEST_ACCOUNT_CLIENT_ID: ${{ secrets.TEST_ACCOUNT_CLIENT_ID }} - TEST_ACCOUNT_CLIENT_SECRET: ${{ secrets.TEST_ACCOUNT_CLIENT_SECRET }}