diff --git a/.github/workflows/register_tre_bundle.yml b/.github/workflows/register_tre_bundle.yml index e08732f..8110a01 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 }} @@ -92,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 @@ -126,7 +119,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 @@ -176,7 +169,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 }} @@ -234,34 +227,8 @@ jobs: - name: Register Bundle uses: ./.github/actions/devcontainer_run_command with: - COMMAND: | - echo "Starting bundle registration" - bundle_name="${{ inputs.bundle_name }}" - bundle_type="${{ inputs.bundle_type }}" - workspace_service_name="${{ inputs.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 - 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 - 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 - 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 - - echo "Finished bundle registration" - DEVCONTAINER_TAG: ${{ needs.prepare-not-main.outputs.refid }} + COMMAND: "make bundle BUNDLE=${{ inputs.bundle_name }} BUNDLE_TYPE=${{ inputs.bundle_type }} WORKSPACE_SERVICE=${{ inputs.workspace_service_name }}" + DEVCONTAINER_TAG: 'latest' AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} AZURE_ENVIRONMENT: ${{ vars.AZURE_ENVIRONMENT }} CI_CACHE_ACR_NAME: ${{ secrets.ACR_NAME}}