forked from maya-a-iuga/Web-App-DevOps-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
52 lines (45 loc) · 1.49 KB
/
azure-pipelines.yml
File metadata and controls
52 lines (45 loc) · 1.49 KB
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
# 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
# Do not trigger on Pull Request creation
# This setting is sneaky: it 'sticks' when removed
pr: none
# Only trigger once for each merge or individual (manual) commit on the main branch
trigger:
batch: 'true'
branches:
include:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@2
inputs:
containerRegistry: 'apmc-docker'
repository: 'asoundmove/aicore-devopsproject-webapp'
command: 'buildAndPush'
Dockerfile: '**/Dockerfile'
tags: latest
- task: Kubernetes@1
inputs:
connectionType: 'Kubernetes Service Connection'
kubernetesServiceEndpoint: 'aicore-apmc-aks'
namespace: 'default'
command: 'apply'
useConfigurationFile: true
configuration: 'k8s-webapp/application-manifest.yaml'
containerRegistryType: 'Container Registry'
dockerRegistryEndpoint: 'apmc-docker'
# Because were-use the 'latest' tag for new versions of the docker image,
# 'apply' above will not deploy, so we need to 'rollout' as well.
- task: Kubernetes@1
inputs:
connectionType: 'Kubernetes Service Connection'
kubernetesServiceEndpoint: 'aicore-apmc-aks'
namespace: 'default'
command: 'rollout'
arguments: 'restart deployment/webapp-deployment'
useConfigurationFile: false
containerRegistryType: 'Container Registry'
dockerRegistryEndpoint: 'apmc-docker'