-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yaml
56 lines (51 loc) · 1.41 KB
/
azure-pipelines.yaml
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
trigger:
branches:
include:
- main
pool:
vmImage: "ubuntu-latest"
variables:
DOCKER_HUB_USER: "omaciasd"
buildConfiguration: "Release"
stages:
- stage: build
displayName: "Build"
jobs:
- job: build
displayName: "Build job"
steps:
- task: Docker@2
displayName: "Build and push Docker image"
inputs:
containerRegistry: "$(DOCKER_HUB_USER)"
repository: "microservicio-python"
command: "buildAndPush"
Dockerfile: "**/Dockerfile"
tags: |
$(Build.BuildId)
- stage: test
displayName: "Test"
jobs:
- job: RunPythonTests
displayName: "Run Python tests"
pool:
vmImage: "ubuntu-latest"
steps:
- task: PythonScript@2
displayName: "Run tests"
inputs:
scriptSource: "filePath"
scriptPath: "path_to_your_test_script.py"
- stage: deploy
displayName: "Deploy"
jobs:
- job: deploy
displayName: "Deploy job"
steps:
- task: AzureKubernetesServiceDeployment@2
displayName: "Deploy to K8s"
inputs:
kubernetesServiceConnection: "your-k8s-connection"
namespace: "tech.prod"
deploymentName: "python-microservice"
containerRegistry: "your-container-registry"