Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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:main
base:main
Choose a base branch
Loading
fromkjurkiew:main
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
12 commits
Select commitHold shift + click to select a range
f30ad07
Set up CI with Azure Pipelines
kjurkiewMar 8, 2025
f3664b8
Update azure-pipelines.yml for Azure Pipelines
kjurkiewMar 8, 2025
87ebdba
Update azure-pipelines.yml for Azure Pipelines
kjurkiewMar 8, 2025
589d140
Update README.md
kjurkiewMar 9, 2025
820b51b
Set up CI with Azure Pipelines
kjurkiewMar 9, 2025
6735c0c
Update azure-pipelines-1.yml for Azure Pipelines
kjurkiewMar 9, 2025
e1d532c
Update azure-pipelines-1.yml for Azure Pipelines
kjurkiewMar 9, 2025
669e48f
Update azure-pipelines-1.yml for Azure Pipelines
kjurkiewMar 9, 2025
195879d
Set up CI with Azure Pipelines
kjurkiewMar 9, 2025
ed3304c
Update azure-pipelines-2.yml for Azure Pipelines
kjurkiewMar 9, 2025
dddf1fe
Update azure-pipelines-2.yml for Azure Pipelines
kjurkiewMar 9, 2025
435d562
Update azure-pipelines-2.yml for Azure Pipelines
kjurkiewMar 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionsREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
[![Build Status](https://dev.azure.com/azr12202412/FabrikamFiber/_apis/build/status%2Fkjurkiew.python-sample-vscode-flask-tutorial?branchName=main)](https://dev.azure.com/azr12202412/FabrikamFiber/_build/latest?definitionId=1&branchName=main)
# Python/Flask Tutorial for Visual Studio Code

* 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.
Expand Down
48 changes: 48 additions & 0 deletionsazure-pipelines-1.yml
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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
View file
Open in desktop
Original file line numberDiff line numberDiff 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'

[8]ページ先頭

©2009-2025 Movatter.jp