-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
62 lines (59 loc) · 2.26 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
# 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
parameters:
- name: "SERVICE_CONNECTION"
type: string
- name: "REGISTRY"
type: string
- name: "REPOSITORY"
type: string
- name: "DIGEST"
type: string
- name: "STATE_FILE"
type: string
- name: "RETENTION_PERIOD"
type: string
pool:
vmImage: ubuntu-latest
jobs:
- job: LockACRImage
displayName: "Lock prod ACR image"
steps:
- checkout: self
persistCredentials: true
- template: ./test.yaml
parameters:
SERVICE_CONNECTION: ${{ parameters.SERVICE_CONNECTION }}
REGISTRY: ${{ parameters.REGISTRY }}
REPOSITORY: ${{ parameters.REPOSITORY }}
DIGEST: ${{ parameters.DIGEST }}
STATE_FILE: ${{ parameters.STATE_FILE }}
RETENTION_PERIOD: ${{ parameters.RETENTION_PERIOD }}
- task: CmdLine@2
inputs:
script: |
git -C $(Build.SourcesDirectory)/ config user.email "wickram95@gmail.com"
git -C $(Build.SourcesDirectory)/ config user.name "WickramBug"
git -C $(Build.SourcesDirectory)/ checkout main
git -C $(Build.SourcesDirectory)/ pull origin main
git -C $(Build.SourcesDirectory)/ add $(Build.SourcesDirectory)/acr-pord-image-tags.txt
git -C $(Build.SourcesDirectory)/ commit -m "[Prod] Update state file via pipeline for the latest build - $(Build.SourceBranchName)"
git -C $(Build.SourcesDirectory)/ push origin main
echo "[Prod] State file update is completed!"
displayName: "Push updated state file to Repo"
- job: SendingAlert
displayName: "Sending Google chat alert"
dependsOn:
- LockACRImage
condition: eq(dependencies.LockACRImage.result, 'Failed')
steps:
- template: "alerts/send-alert-acr-prod-image-lock.yaml"
parameters:
PIPELINE_NAME: "Asgardeo ACR Image Lock"
ENVIRONMENT: "PROD"
PIPELINE_STATUS: "Failed"
GOOGLE_CHAT_SPACE: "AAAA-y5RxXY"
GOOGLE_CHAT_KEY: "AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI"
GOOGLE_CHAT_TOKEN: "n678xyeVxt1ZXmw052hT_4pgJIm1BNSNE-iYDf0AgZY%3D"