From 5d8c86fbf1eb864ba84b7221668b481dec78fa83 Mon Sep 17 00:00:00 2001 From: John Collinson Date: Wed, 22 May 2024 11:39:15 +0100 Subject: [PATCH] Lock swagger install to a specific version (#70) --- .github/workflows/ci-pipeline.yaml | 2 +- .pipelines/ci-pipeline.yaml | 2 +- Directory.Packages.props | 2 +- docs/developer/swagger-file.md | 2 +- {.pipelines/scripts => scripts}/generate-swagger.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename {.pipelines/scripts => scripts}/generate-swagger.sh (78%) diff --git a/.github/workflows/ci-pipeline.yaml b/.github/workflows/ci-pipeline.yaml index f5b3ab62..32d2ed3c 100644 --- a/.github/workflows/ci-pipeline.yaml +++ b/.github/workflows/ci-pipeline.yaml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - name: Build and Publish Swagger Docs - run: mkdir -p ${{ github.workspace }}/swagger-artifacts && bash ${{ github.workspace }}/.pipelines/scripts/generate-swagger.sh ${{ github.workspace }}/swagger-artifacts + run: mkdir -p ${{ github.workspace }}/swagger-artifacts && bash ${{ github.workspace }}/scripts/generate-swagger.sh ${{ github.workspace }}/swagger-artifacts env: ASPNETCORE_ENVIRONMENT: 'Local' diff --git a/.pipelines/ci-pipeline.yaml b/.pipelines/ci-pipeline.yaml index 7d349549..992fc2f6 100644 --- a/.pipelines/ci-pipeline.yaml +++ b/.pipelines/ci-pipeline.yaml @@ -36,7 +36,7 @@ stages: inputs: targetType: 'inline' script: | - bash $(Build.SourcesDirectory)/.pipelines/scripts/generate-swagger.sh $(Build.ArtifactStagingDirectory) + bash $(Build.SourcesDirectory)/scripts/generate-swagger.sh $(Build.ArtifactStagingDirectory) displayName: 'Build and Publish Swagger Docs' env: ASPNETCORE_ENVIRONMENT: 'Local' diff --git a/Directory.Packages.props b/Directory.Packages.props index 8ffaff8d..8afe9050 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -26,7 +26,7 @@ - + diff --git a/docs/developer/swagger-file.md b/docs/developer/swagger-file.md index b0a3228f..030e1c4f 100644 --- a/docs/developer/swagger-file.md +++ b/docs/developer/swagger-file.md @@ -6,7 +6,7 @@ The file is then used by the CD pipeline and terraform to create the API in the In order to generate the swagger file for local testing, you can run the following script: ```bash -bash ./.pipelines/scripts/generate-swagger.sh infrastructure/services/api_management +bash ./scripts/generate-swagger.sh infrastructure/services/api_management ``` This script will generate the swagger file and store it in the `infrastructure/services/api_management` folder. The file can then be used to create the API in the API Management via terraform. diff --git a/.pipelines/scripts/generate-swagger.sh b/scripts/generate-swagger.sh similarity index 78% rename from .pipelines/scripts/generate-swagger.sh rename to scripts/generate-swagger.sh index 8c21b450..55f930e2 100644 --- a/.pipelines/scripts/generate-swagger.sh +++ b/scripts/generate-swagger.sh @@ -3,7 +3,7 @@ # Get the artifact path parameter artifact_path=$1 -dotnet tool install -g Swashbuckle.AspNetCore.Cli +dotnet tool install -g Swashbuckle.AspNetCore.Cli --version 6.6.2 dotnet build HealthcareDataExchange.sln -c Release cp -r src/Api/bin/Release/net8.0/* $artifact_path cd $artifact_path