Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trigger:
- branches:
- include:
- # This will ensure that the pipeline is only triggered when the code changes are made to the 'master' branch.
- - master
- paths:
- include:
- # This will ensure that the pipeline is only triggered when coomits/PR contain changes in this particular
- # folder. You can of course choose to omit this, if you always want it to trigger, regardless of what code
- # is changed in the repository.
- - 'source/code/path/*'
- variables:
- bin: '$(Build.BinariesDirectory)'
- zip: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
- jobs:
- - job: Build
- displayName: Build
- pool:
- # You can use 'ubuntu-latest' here as well. Currently translates to 18.04. 20.04 is currently in preview,
- # and I do not recommend using it (I used not long ago, and it was causing a lot of issues). If you go
- # with 'ubuntu-latest', be prepared for a pipeline that'll potentially start breaking when 'latest'
- # will translate to 20.04.
- vmImage: ubuntu-18.04
- steps:
- - task: DeleteFiles@1
- inputs:
- SourceFolder: '$(bin)'
- # I don't really know if this step is needed. I haven't built any python function apps, but it was part of the template file,
- # so I thought it would be a good idea to include it here as well. If you know better, do with it whatever you want. :-)
- - bash: |
- if [ -f extensions.csproj ]
- then
- dotnet build extensions.csproj --runtime ubuntu.16.04-x64 --output ./bin
- fi
- workingDirectory: $(bin)
- displayName: 'Build extensions'
- # Functions V2 supports Python 3.6 as of today
- - task: UsePythonVersion@0
- displayName: 'Use Python 3.6'
- inputs:
- versionSpec: 3.6
- - bash: |
- python -m venv worker_venv
- source worker_venv/bin/activate
- pip install -r requirements.txt
- workingDirectory: $(bin)
- displayName: 'Install application dependencies'
- - task: ArchiveFiles@2
- displayName: 'Archive files'
- inputs:
- rootFolderOrFile: '$(bin)'
- includeRootFolder: false
- archiveType: zip
- archiveFile: '$(zip)'
- replaceExistingArchive: true
- # You probably want to change the name of the artifact ;-)
- - task: PublishBuildArtifacts@1
- displayName: 'Publish articats'
- inputs:
- ArtifactName: 'My precious'
- PathtoPublish: '$(zip)'
Advertisement
Add Comment
Please, Sign In to add comment