From 73d31f1e8f52cbcb3a80c2bd5b2a7632a92ff3ec Mon Sep 17 00:00:00 2001 From: Umesh-Phendarkar Date: Sat, 23 Nov 2024 17:35:09 +0530 Subject: [PATCH 1/6] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..bf56801d7 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,34 @@ +# ASP.NET +# Build and test ASP.NET projects. +# Add steps that publish symbols, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4 + +trigger: +- main + +pool: + vmImage: 'windows-latest' + +variables: + solution: '**/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +steps: +- task: NuGetToolInstaller@1 + +- task: NuGetCommand@2 + inputs: + restoreSolution: '$(solution)' + +- task: VSBuild@1 + inputs: + solution: '$(solution)' + msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"' + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' + +- task: VSTest@2 + inputs: + platform: '$(buildPlatform)' + configuration: '$(buildConfiguration)' From 05da047c2635d75b97495c3c8abfbb26d5bb3f39 Mon Sep 17 00:00:00 2001 From: Umesh-Phendarkar Date: Sat, 23 Nov 2024 17:38:02 +0530 Subject: [PATCH 2/6] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bf56801d7..928020775 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,4 +1,9 @@ # ASP.NET +- task: UsePythonVersion@0 + inputs: + versionSpec: '3.x' + addToPath: true + architecture: 'x64' # Build and test ASP.NET projects. # Add steps that publish symbols, save build artifacts, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4 From 4df0bded8c689b81a9a57e4db4457bbd2135b3c0 Mon Sep 17 00:00:00 2001 From: Umesh-Phendarkar Date: Sat, 23 Nov 2024 17:39:44 +0530 Subject: [PATCH 3/6] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 64 +++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 928020775..a6489ab30 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,39 +1,45 @@ -# ASP.NET -- task: UsePythonVersion@0 - inputs: - versionSpec: '3.x' - addToPath: true - architecture: 'x64' -# Build and test ASP.NET projects. -# Add steps that publish symbols, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4 - trigger: - main pool: - vmImage: 'windows-latest' + vmImage: ubuntu-latest -variables: - solution: '**/*.sln' - buildPlatform: 'Any CPU' - buildConfiguration: 'Release' +strategy: + matrix: + Python310: + python.version: '3.10' + Python311: + python.version: '3.11' + Python312: + python.version: '3.12' steps: -- task: NuGetToolInstaller@1 + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + displayName: 'Use Python $(python.version)' + + - script: | + python -m pip install --upgrade pip + pip install -r requirements.txt + displayName: 'Install dependencies' -- task: NuGetCommand@2 - inputs: - restoreSolution: '$(solution)' + - task: ArchiveFiles@2 + displayName: 'Archive files' + inputs: + rootFolderOrFile: $(System.DefaultWorkingDirectory) + includeRootFolder: false + archiveType: zip + archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId)-$(python.version).zip + replaceExistingArchive: true -- task: VSBuild@1 - inputs: - solution: '$(solution)' - msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"' - platform: '$(buildPlatform)' - configuration: '$(buildConfiguration)' + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'drop' + publishLocation: 'Container' -- task: VSTest@2 - inputs: - platform: '$(buildPlatform)' - configuration: '$(buildConfiguration)' + - script: | + pip install pytest pytest-azurepipelines + pytest + displayName: 'pytest' \ No newline at end of file From bdd33e5105f8de2bf8f3d217f43b0b47477a1a35 Mon Sep 17 00:00:00 2001 From: Umesh-Phendarkar Date: Sat, 23 Nov 2024 18:38:01 +0530 Subject: [PATCH 4/6] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines-1.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 azure-pipelines-1.yml diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml new file mode 100644 index 000000000..374614aae --- /dev/null +++ b/azure-pipelines-1.yml @@ -0,0 +1,37 @@ +# Python package +# Create and test a Python package on multiple Python versions. +# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/python + +trigger: +- main + +pool: + vmImage: ubuntu-latest + +strategy: + matrix: + Python38: + python.version: '3.8' + Python39: + python.version: '3.9' + Python310: + python.version: '3.10' + Python311: + python.version: '3.11' + +steps: +- task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + displayName: 'Use Python $(python.version)' + +- script: | + python -m pip install --upgrade pip + pip install -r requirements.txt + displayName: 'Install dependencies' + +- script: | + pip install pytest pytest-azurepipelines + pytest + displayName: 'pytest' From 42bfbba1702a3cc626e26a1729327196f3cf5294 Mon Sep 17 00:00:00 2001 From: Umesh-Phendarkar Date: Tue, 26 Nov 2024 12:49:31 +0530 Subject: [PATCH 5/6] Create docker-image.yml --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 000000000..3f53646d1 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From 2c37146eb88a55399bf98aa2a0eef3f1df74f17f Mon Sep 17 00:00:00 2001 From: "Umesh.Phendarkar" Date: Sat, 22 Feb 2025 07:51:35 +0530 Subject: [PATCH 6/6] added comment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 068a76fd5..0bfe8865c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Python/Flask Tutorial for Visual Studio Code +# Python/Flask Tutorial for Visual Studio Code #### Added Comment in Code --By --- Umesh * This sample contains the completed program from the tutorial, make sure to visit the link: [Using Flask in Visual Studio Code](https://code.visualstudio.com/docs/python/tutorial-flask). Intermediate steps are not included.