-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
81 lines (70 loc) · 1.93 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
trigger:
- main
pool: local-agent
resources:
- repo: self
variables:
- group: CICD
- name: app_var
value: $[variables.appVariable]
- group: CICD
- name: arcUser
value: $[variables.acrUsername]
- group: CICD
- name: arcPWD
value: $[variables.acrPassword]
parameters:
- name: tag
default: "$(Build.BuildId)"
- name: imageName
default: "public-api"
#Valores anteriores
#tag: '$(Build.BuildId)'
#imageName: 'public-api'
#vmImageName: ubuntu-latest
stages: #En Github actions esto se llama jobs
- stage: Build
displayName: Build image
jobs: #En GitHub actions se llama steps
- job: Build
displayName: Build
#pool:
# vmImage: $(vmImageName)
steps:
- script: |
echo "var=$(app_var)"
- task: Docker@2
displayName: Build an image
inputs:
repository: ${{ parameters.imageName }}
command: build
containerRegistry: 'registryConnection'
dockerfile: "**/qa.dockerfile"
tags: ${{ parameters.tag }}
arguments: '--build-arg APP_ENV=$(app_var)'
#repository: $(imageName)
#command: build
#dockerfile: '**/qa.dockerfile'
#tags: |
# $(tag)
- task: Docker@2
displayName: 'Push Docker Image'
inputs:
command: 'push'
containerRegistry: 'registryConnection'
repository: ${{ parameters.imageName }}
tags: |
${{ parameters.tag }}
- job: Deploy
displayName: Deploy
dependsOn: Build
steps:
- task: AzureContainerApps@1
inputs:
#Nombre de conector creado en ADS para pegar con webApps
azureSubscription: 'appDeployConnection'
imageToDeploy: acrappsJorge.azurecr.io/${{ parameters.imageName }}:$(Build.BuildId)
containerAppName: 'app-public-app' # NOMBRE DEL CONTAINER APP
resourceGroup: rg-jorge
acrUsername: $(arcUser)
acrPassword: $(arcPWD)