Working Pipeline Code - Using an Azure DevOps Pipeline to deploy WebApp #665
JahzanA-Visma
started this conversation in
Show and tell
Replies: 2 comments
-
do i have to push the .env file also to the azure repo to use this pipeline file? |
Beta Was this translation helpful? Give feedback.
0 replies
-
can you give the sample values of the variables of variables you have used? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
`trigger:
branches:
include:
- develop
variables:
azureServiceConnectionId: ""
webAppName: ""
vmImageName: "ubuntu-latest"
environmentName: ""
projectRoot: $(System.DefaultWorkingDirectory)
stages:
stage: Build
displayName: Build stage
jobs:
pool:
vmImage: $(vmImageName)
steps:
task: UsePythonVersion@0
displayName: 'Use Python'
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 Python Requirements"
task: NodeTool@0
inputs:
versionSpec: '20.x'
displayName: 'Install Node.js'
script: |
cd ./frontend
npm install
npm run build
cd ..
rm -rf $(projectRoot)/frontend/node_modules
displayName: 'npm install and build, removing node_modules'
task: ArchiveFiles@2$(Build.ArtifactStagingDirectory)/$ (Build.BuildId).zip
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(projectRoot)'
includeRootFolder: false
archiveType: zip
archiveFile:
replaceExistingArchive: true
upload:$(Build.ArtifactStagingDirectory)/$ (Build.BuildId).zip
displayName: 'Upload package'
artifact: drop
stage: Deploy
displayName: 'Deploy Web App'
dependsOn: Build
condition: succeeded()
jobs:
pool:
vmImage: $(vmImageName)
environment: $(environmentName)
strategy:
runOnce:
deploy:
steps:
- task: UsePythonVersion@0
displayName: 'Use Python version'
- task: AzureWebApp@1
displayName: 'Deploy Azure Web App : {{ webAppName }}'
inputs:
azureSubscription: $(azureServiceConnectionId)
appName: $(webAppName)
package:
Beta Was this translation helpful? Give feedback.
All reactions