-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
32 lines (28 loc) · 1.37 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- master
- develop
- ft*
pool:
vmImage: 'windows-2019'
steps:
- script: |
mvnw -DfunctionAppName=question-service-$(Build.SourceBranchName) clean package
displayName: Build package
- task: AzureCLI@2
displayName: 'Deploy app'
inputs:
addSpnToEnvironment: true
failOnStandardError: true
azureSubscription: question-service-hzprod-rg-access
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
$xmlcontent = ("<settings xmlns=`"http://maven.apache.org/SETTINGS/1.0.0`" xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`" xsi:schemaLocation=`"http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd`"><servers><server><id>azure-auth</id><configuration><client>$env:servicePrincipalId</client><tenant>$env:tenantId</tenant><key>$env:servicePrincipalKey</key><environment>AZURE</environment></configuration></server></servers></settings>")
$xmlcontent
New-Item -Path '.\.mvn\settings.xml' -ItemType "file" -Value "$xmlcontent"
cat .\.mvn\settings.xml
.\mvnw --settings .\.mvn\settings.xml -DfunctionAppName=question-service-$(Build.SourceBranchName) azure-functions:deploy -X