-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipelines.yml
58 lines (54 loc) · 1.63 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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
name: CI-CD
trigger:
- main
pool:
vmImage: ubuntu-latest
stages:
- stage: CI
displayName: 'CI - Pipeline de CI'
jobs:
- job: BuildAndTest
displayName: 'Build do Projeto e Teste'
steps:
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: 'build'
projects: './src/Review-Filmes.sln'
- task: DotNetCoreCLI@2
displayName: Teste
inputs:
command: 'test'
projects: './src/Review-Filmes.Test.Unit/Review-Filmes.Test.Unit.csproj'
- job: Release
displayName: 'Release Docker'
dependsOn: BuildAndTest
steps:
- task: Docker@2
inputs:
containerRegistry: 'DockerHub'
repository: 'fabricioveronez/live-azure-devops'
command: 'buildAndPush'
Dockerfile: './src/Review-Filmes.Web/Dockerfile'
buildContext: './src'
tags: |
$(Build.BuildId)
latest
- stage: CD
displayName: 'CD - Pipeline de CD'
jobs:
- job: Deploy
displayName: 'Deploy no Kubernetes'
steps:
- task: KubernetesManifest@1
inputs:
action: 'deploy'
connectionType: 'kubernetesServiceConnection'
kubernetesServiceConnection: 'k8s'
namespace: 'default'
manifests: './k8s/deployment.yaml'
containers: 'fabricioveronez/live-azure-devops:$(Build.BuildId)'