- Notifications
You must be signed in to change notification settings - Fork6.3k
Set up CI with Azure Pipelines#112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
kjurkiew wants to merge12 commits intomicrosoft:mainChoose a base branch fromkjurkiew:main
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Changes fromall commits
Commits
Show all changes
12 commits Select commitHold shift + click to select a range
f30ad07 Set up CI with Azure Pipelines
kjurkiewf3664b8 Update azure-pipelines.yml for Azure Pipelines
kjurkiew87ebdba Update azure-pipelines.yml for Azure Pipelines
kjurkiew589d140 Update README.md
kjurkiew820b51b Set up CI with Azure Pipelines
kjurkiew6735c0c Update azure-pipelines-1.yml for Azure Pipelines
kjurkiewe1d532c Update azure-pipelines-1.yml for Azure Pipelines
kjurkiew669e48f Update azure-pipelines-1.yml for Azure Pipelines
kjurkiew195879d Set up CI with Azure Pipelines
kjurkiewed3304c Update azure-pipelines-2.yml for Azure Pipelines
kjurkiewdddf1fe Update azure-pipelines-2.yml for Azure Pipelines
kjurkiew435d562 Update azure-pipelines-2.yml for Azure Pipelines
kjurkiewFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletionsREADME.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletionsazure-pipelines-1.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Starter pipeline | ||
| # Start with a minimal pipeline that you can customize to build and deploy your code. | ||
| # Add steps that build, run tests, deploy, and more: | ||
| # https://aka.ms/yaml | ||
| trigger: | ||
| - main | ||
| pool: | ||
| name: 'default' | ||
| strategy: | ||
| matrix: | ||
| Python38: | ||
| python.version: '3.8' | ||
| Python39: | ||
| python.version: '3.9' | ||
| Python310: | ||
| python.version: '3.10' | ||
| 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' | ||
| - 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: PublishBuildArtifacts@1 | ||
| inputs: | ||
| PathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
| ArtifactName: 'drop' | ||
| publishLocation: 'Container' | ||
| - script: | | ||
| pip install pytest pytest-azurepipelines | ||
| pytest | ||
| displayName: 'pytest' |
88 changes: 88 additions & 0 deletionsazure-pipelines-2.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # Python to Linux Web App on Azure | ||
| # Build your Python project and deploy it to Azure as a Linux Web App. | ||
| # Change python version to one thats appropriate for your application. | ||
| # https://docs.microsoft.com/azure/devops/pipelines/languages/python | ||
| trigger: | ||
| - main | ||
| variables: | ||
| # Azure Resource Manager connection created during pipeline creation | ||
| azureServiceConnectionId: 'a5dd3b02-393d-484d-9f87-6d882d1248e5' | ||
| # Web app name | ||
| webAppName: 'pythonsamplevscodeflaskappkj' | ||
| # Agent VM image name | ||
| vmImageName: 'ubuntu-latest' | ||
| # Environment name | ||
| environmentName: 'pythonsamplevscodeflaskappbz' | ||
| # Project root folder. Point to the folder containing manage.py file. | ||
| projectRoot: $(System.DefaultWorkingDirectory) | ||
| pythonVersion: '3.9' | ||
| stages: | ||
| - stage: Build | ||
| displayName: Build stage | ||
| jobs: | ||
| - job: BuildJob | ||
| pool: | ||
| #vmImage: $(vmImageName) | ||
| name: 'default' | ||
| steps: | ||
| - task: UsePythonVersion@0 | ||
| inputs: | ||
| versionSpec: '$(pythonVersion)' | ||
| displayName: 'Use Python $(pythonVersion)' | ||
| - script: | | ||
| python -m venv antenv | ||
| source antenv/bin/activate | ||
| python -m pip install --upgrade pip | ||
| pip install setup | ||
| pip install -r requirements.txt | ||
| workingDirectory: $(projectRoot) | ||
| displayName: "Install requirements" | ||
| - task: ArchiveFiles@2 | ||
| displayName: 'Archive files' | ||
| inputs: | ||
| rootFolderOrFile: '$(projectRoot)' | ||
| includeRootFolder: false | ||
| archiveType: zip | ||
| archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip | ||
| replaceExistingArchive: true | ||
| - upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip | ||
| displayName: 'Upload package' | ||
| artifact: drop | ||
| - stage: Deploy | ||
| displayName: 'Deploy Web App' | ||
| dependsOn: Build | ||
| condition: succeeded() | ||
| jobs: | ||
| - deployment: DeploymentJob | ||
| pool: | ||
| #vmImage: $(vmImageName) | ||
| name: 'default' | ||
| environment: $(environmentName) | ||
| strategy: | ||
| runOnce: | ||
| deploy: | ||
| steps: | ||
| - task: UsePythonVersion@0 | ||
| inputs: | ||
| versionSpec: '$(pythonVersion)' | ||
| displayName: 'Use Python version' | ||
| - task: AzureWebApp@1 | ||
| displayName: 'Deploy Azure Web App : pythonsamplevscodeflaskappkj' | ||
| inputs: | ||
| azureSubscription: $(azureServiceConnectionId) | ||
| appName: $(webAppName) | ||
| package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip |
38 changes: 38 additions & 0 deletionsazure-pipelines.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # 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: | ||
| name: 'default' | ||
| 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' |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.