Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3dce16d
Set up CI with Azure Pipelines
GliciniaD Mar 1, 2026
a86aacc
Set up CI with Azure Pipelines
GliciniaD Mar 1, 2026
9b4a944
Update azure-pipelines.yml to save to artifact
GliciniaD Mar 1, 2026
a1ea7e2
Update azure-pipelines.yml for Azure Pipelines
GliciniaD Mar 1, 2026
04fa940
Update azure-pipelines.yml for Azure Pipelines
GliciniaD Mar 1, 2026
7dc05c6
Update azure-pipelines.yml for Azure Pipelines
GliciniaD Mar 1, 2026
d552604
Update azure-pipelines.yml for Azure Pipelines
GliciniaD Mar 1, 2026
a4f3336
Update azure-pipelines.yml for Azure Pipelines
GliciniaD Mar 1, 2026
00de496
Update azure-pipelines.yml for Azure Pipelines
GliciniaD Mar 1, 2026
ba371f4
Set up CI with Azure Pipelines
GliciniaD Mar 1, 2026
241c3f4
Update azure-pipelines-2.yml for Azure Pipelines
GliciniaD Mar 1, 2026
645e0fa
Update azure-pipelines-2.yml for Azure Pipelines
GliciniaD Mar 1, 2026
a6ac991
Set up CI with Azure Pipelines
GliciniaD Mar 1, 2026
ccb7bac
Set up CI with Azure Pipelines
GliciniaD Mar 1, 2026
6641de1
Update azure-pipelines-4.yml for Azure Pipelines
GliciniaD Mar 1, 2026
596869f
Update azure-pipelines-4.yml for Azure Pipelines
GliciniaD Mar 1, 2026
4b2667c
Update azure-pipelines-4.yml for Azure Pipelines
GliciniaD Mar 1, 2026
3f730e4
Set up CI with Azure Pipelines
GliciniaD Mar 7, 2026
b986c46
Update azure-pipelines-5.yml for Azure Pipelines
GliciniaD Mar 7, 2026
24f2ece
Update azure-pipelines-5.yml for Azure Pipelines
GliciniaD Mar 7, 2026
d030736
Update azure-pipelines-5.yml for Azure Pipelines
GliciniaD Mar 8, 2026
7dce120
Update azure-pipelines-5.yml for Azure Pipelines
GliciniaD Mar 8, 2026
7b88b87
Update azure-pipelines-5.yml for Azure Pipelines
GliciniaD Mar 8, 2026
7a06d3a
Update azure-pipelines-5.yml for Azure Pipelines
GliciniaD Mar 8, 2026
1ed6412
Update azure-pipelines-5.yml for Azure Pipelines
GliciniaD Mar 8, 2026
1b99d43
Update azure-pipelines-5.yml for Azure Pipelines
GliciniaD Mar 8, 2026
c441a94
Create app.py
GliciniaD Mar 8, 2026
be328f7
Update requirements.txt
GliciniaD Mar 8, 2026
e821e60
Update azure-pipelines-5.yml for Azure Pipelines
GliciniaD Mar 8, 2026
3905a4d
Update azure-pipelines.yml for Azure Pipelines
GliciniaD Mar 8, 2026
457e0d4
Update azure-pipelines-2.yml for Azure Pipelines
GliciniaD Mar 8, 2026
b084e01
Update azure-pipelines-5.yml for Azure Pipelines
GliciniaD Mar 8, 2026
c8bd291
Update azure-pipelines-4.yml for Azure Pipelines
GliciniaD Mar 8, 2026
d8ed07a
test to see if all pipelines run again
GliciniaD Mar 8, 2026
50b2d46
test 2
GliciniaD Mar 8, 2026
cfe466a
Update azure-pipelines-2.yml
GliciniaD Mar 19, 2026
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
7 changes: 7 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from flask import Flask

app = Flask(__name__)

@app.route("/")
def home():
return "Hello from Flask!If you can see this, the code has been deployed to your webapp. Test to see if all pipelines run again 2x"
19 changes: 19 additions & 0 deletions azure-pipelines-1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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:
vmImage: ubuntu-latest

steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'

- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
41 changes: 41 additions & 0 deletions azure-pipelines-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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 removed to avoid it all running and taking up microsoft agents
#trigger removed to avoid it all running and taking up microsoft agents

pool:
vmImage: ubuntu-latest

stages:
#Build Stage
- stage: Build
jobs:
- job: BuildJob
steps:
- script: echo "Hey there, this is the building stage!"
#Dev Environment
- stage: Dev
dependsOn: Build
jobs:
- deployment: DeployDev
environment: Dev
strategy:
runOnce:
deploy:
steps:
- script: echo "Deploying to Dev!"

#Prod Environment
- stage: Prod
dependsOn: Dev
jobs:
- deployment: DeployProd
environment: Prod
strategy:
runOnce:
deploy:
steps:
- script: echo "Deploying to Prod!"
43 changes: 43 additions & 0 deletions azure-pipelines-3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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'

jobs:
- job: TestAndCoverage
display name:'Run Python Tests and collect Coverage'

steps:
#Install Python and pip
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt

#Install Test and Coverage tool
- script: |
pytest --cov=. --cov-report=xml
displayName: 'Install test and coverage checker'

# Publish coverage results
- task: PublishCoveCoverageResults@1
inputs:
codeCoverageTool: 'Covertura'
summaryFileLocation:'coverage.xml'
displayName:'Publish Code to ADO'

36 changes: 36 additions & 0 deletions azure-pipelines-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

pool:
vmImage: ubuntu-latest

jobs:
- job: TestAndCoverage
displayName: 'Run Python Tests and collect Coverage'
strategy:
matrix:
Python38:
python.version: '3.8'
Python39:
python.version: '3.9'
steps:
# Install Python and the coverage checker
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'

- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov
displayName: 'Install dependencies'

# Run tests and collect coverage
- script: |
pytest --cov=. --cov-report=xml
displayName: 'Run Tests and Coverage'

# Publish coverage results
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: 'coverage.xml'
displayName: 'Publish Code Coverage to ADO'
77 changes: 77 additions & 0 deletions azure-pipelines-5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Pipeline to create webapp, build, deploy, and reminder

pool:
vmImage: ubuntu-latest

stages:
# ===============================
# Stage 1: Create Web App
# ===============================
- stage: CreateWebApp
displayName: Create Web App on Azure
jobs:
- job: CreateApp
displayName: Create app via CLI
steps:
- task: AzureCLI@2
displayName: "Create Web App if not exists"
inputs:
azureSubscription: SPN-Dev-01
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
if az webapp show --name flaskappgmd28 --resource-group AZ400-play &>/dev/null; then
echo "Web app already exists, skipping creation"
else
az webapp create --resource-group AZ400-play --plan ASP-AzureAppIncidentProjectgroup-8d3f --name flaskappgmd28 --runtime "PYTHON:3.10"
fi

# ===============================
# Stage 2: Build Python App
# ===============================
- stage: BuildApp
displayName: 'Build Python Stage'
dependsOn: CreateWebApp
jobs:
- job: BuildAppOnDevops
displayName: 'Build App on DevOps'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
addToPath: true
- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
displayName: 'Install dependencies'

# ===============================
# Stage 3: Deploy App
# ===============================
- stage: DeployApp
displayName: 'Deploy App Stage'
dependsOn: BuildApp
jobs:
- job: DeployToAzure
displayName: 'Deploy Build App to Azure'
steps:
- task: AzureWebApp@1
inputs:
azureSubscription: SPN-Dev-01
appType: webApp
appName: flaskappgmd28
package: '$(System.DefaultWorkingDirectory)'
startupCommand: 'gunicorn --bind 0.0.0.0:8000 app:app'

# ===============================
# Stage 4: Reminder
# ===============================
- stage: ReminderToDelete
displayName: 'Reminder to delete'
dependsOn: DeployApp
jobs:
- job: Reminder
displayName: 'Text reminder'
steps:
- script: |
echo "Delete or at least stop"
48 changes: 48 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

pool:
vmImage: 'ubuntu-latest'

variables:
feedName: 'Test-feed' # <-- Replace with your Azure Artifacts feed
packageName: 'flask-sample-app' # <-- Name for the universal package
packageVersion: '1.0.$(Build.BuildId)'

steps:

# 1️⃣ Checkout your GitHub repo
- checkout: self
displayName: 'Checkout repository'

# 2️⃣ Optional: Debug repo contents
- script: |
echo "Repo root: $(Build.SourcesDirectory)"
echo "Contents:"
ls -la $(Build.SourcesDirectory)
displayName: 'List repo root contents'

# 3️⃣ Ensure artifact staging directory exists
- script: mkdir -p $(Build.ArtifactStagingDirectory)
displayName: 'Ensure artifact staging directory exists'

# 4️⃣ Archive the entire repo into a zip
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)' # <-- This is the correct folder
includeRootFolder: false # <-- Include only contents
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/flask-app.zip'
replaceExistingArchive: true
displayName: 'Archive repository'

# 5️⃣ Publish the zip as a Universal Package
- task: UniversalPackages@0
inputs:
command: publish
publishDirectory: '$(Build.ArtifactStagingDirectory)'
feedsToUsePublish: 'internal'
vstsFeedPublish: 'DevOpsAZ400 Pratice (Agile one)/Test-Feed'
vstsFeedPackagePublish: '$(packageName)'
versionOption: 'custom'
versionPublish: '$(packageVersion)'
packagePublishDescription: 'Simple Flask sample app packaged as Universal Package'
displayName: 'Publish Universal Package'
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Flask
Flask==2.3.0
gunicorn==20.1.0