Skip to content

Dev #116

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open

Dev #116

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
dbffa72
Set up CI with Azure Pipelines
RaduHasegan Apr 24, 2025
9ac3b70
Update azure-pipelines.yml
RaduHasegan Apr 24, 2025
b82a5a2
Update azure-pipelines.yml
RaduHasegan Apr 24, 2025
a07533d
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 24, 2025
af05e7a
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 24, 2025
998ce96
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 24, 2025
a2daffd
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 24, 2025
ca510e3
Create version.txt
RaduHasegan Apr 25, 2025
c84546f
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 2025
30ceb42
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 2025
73c3125
Update home.html
RaduHasegan Apr 25, 2025
ec24b27
Update home.html
RaduHasegan Apr 25, 2025
e5f2379
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 2025
c7a90fc
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 2025
f601b2b
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 2025
aecc0a2
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 2025
22014a4
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 2025
0188198
Increment version to 1.0.1
RaduHasegan Apr 25, 2025
0690bed
Increment version to 1.0.2
RaduHasegan Apr 25, 2025
17bd87a
Update home.html
RaduHasegan Apr 25, 2025
96cfd9b
Increment version to 1.0.3
RaduHasegan Apr 25, 2025
67cd2a1
Increment version to 1.0.4
RaduHasegan Apr 25, 2025
49c9e02
Increment version to 1.0.5
RaduHasegan Apr 25, 2025
5429eae
Increment version to 1.0.6
RaduHasegan Apr 25, 2025
ab612ed
Increment version to 1.0.7
RaduHasegan Apr 25, 2025
d9f52ec
Increment version to 1.0.8
RaduHasegan Apr 25, 2025
ed0c857
Increment version to 1.0.9
RaduHasegan Apr 25, 2025
dac97c1
Increment version to 1.0.10
RaduHasegan Apr 25, 2025
8d6d6f2
Update version.txt
RaduHasegan Apr 25, 2025
0e76775
Increment version to 1.0.4
RaduHasegan Apr 25, 2025
93211fb
Increment version to 1.0.5
RaduHasegan Apr 25, 2025
a5b44b0
Increment version to 1.0.6
RaduHasegan Apr 25, 2025
1b652b2
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 2025
f392b60
Increment version to 1.0.7
RaduHasegan Apr 25, 2025
756279f
Increment version to 1.0.8
RaduHasegan Apr 25, 2025
8be9c3a
Increment version to 1.0.9
RaduHasegan Apr 25, 2025
3231487
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 2025
708a236
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 2025
693215c
Increment version to 1.0.10
RaduHasegan Apr 25, 2025
d2085fd
Update azure-pipelines.yml for Azure Pipelines
RaduHasegan Apr 25, 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
122 changes: 122 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# 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: 'b69a0940-36ac-4582-9575-7ccd036b954e'

# Web app name
webAppName: 'webapp1312'

# Agent VM image name
vmImageName: 'ubuntu-latest'

# Environment name
environmentName: 'webapp1312'

# Project root folder. Point to the folder containing manage.py file.
projectRoot: $(System.DefaultWorkingDirectory)

pythonVersion: '3.11'

resources:
repositories:
- repository: flaskApp
type: github
name: RaduHasegan/python-sample-vscode-flask-tutorial
endpoint: github.com_RaduHasegan

stages:
- stage: Build
displayName: Build stage
jobs:
- job: BuildJob
pool:
vmImage: $(vmImageName)
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: Release
displayName: 'Create Release with Tag'
jobs:
- job: ReleaseJob
displayName: 'Release Job'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: flaskApp
persistCredentials: true

# Get the version (tag) from the version.txt file
- bash: |
version=$(cat version.txt)
IFS='.' read -ra parts <<< "$version"
patch=$((parts[2] + 1))
new_version="${parts[0]}.${parts[1]}.$patch"
echo $new_version > version.txt
echo "##vso[build.updatebuildnumber]$new_version"
displayName: 'Increment patch version'
# - bash: |
# git fetch origin
# git checkout dev
# git config user.name "Radu Hasegan"
# git config user.email "radu.hasegan80@gmail.com"
# git add version.txt
# git commit -m "Increment version to $(cat version.txt)"
# git push origin dev
# displayName: 'Commit new version'
# condition: succeeded()
- stage: Deploy
displayName: 'Deploy Web App'
dependsOn: Release
condition: succeeded()
jobs:
- deployment: DeploymentJob
pool:
vmImage: $(vmImageName)
environment: $(environmentName)
strategy:
runOnce:
deploy:
steps:

- task: UsePythonVersion@0
inputs:
versionSpec: '$(pythonVersion)'
displayName: 'Use Python version'

- task: AzureWebApp@1
displayName: 'Deploy Azure Web App : webapp1312'
inputs:
azureSubscription: $(azureServiceConnectionId)
appName: $(webAppName)
package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip
2 changes: 1 addition & 1 deletion hello_app/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Home
{% endblock %}
{% block content %}
<p>Home page for the Visual Studio Code Flask tutorial.</p>
<p>Radunew2 Home page for the Visual Studio Code Flask tutorial.</p>
{% endblock %}
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.10