forked from thejungwon/docker-reactjs
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
103 lines (87 loc) · 2.62 KB
/
azure-pipelines.yml
File metadata and controls
103 lines (87 loc) · 2.62 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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: SonarQualityGateCheck
jobs:
- job: SonarQualityGateCheckJob
displayName: 'Sonar Quality Gate Check'
steps:
- checkout: self
# Run SonarQube quality gate check using Bash script
- script: |
pwd
# pool:
# vmImage: 'ubuntu-latest'
# variables:
# - group: sonarlogin
# - name: acrServiceConnection
# value: 'acr-connection'
# - name: sonarServiceConnection
# value: 'sonar-connection'
# - name: aksServiceConnection
# value: 'aks-connection'
# stages:
# - stage: Analysis
# jobs:
# - job: AnalysisJob
# displayName: 'Run Analysis'
# steps:
# - checkout: self
# # SonarQube Prepare Analysis Configuration
# - task: SonarQubePrepare@4
# inputs:
# SonarQube: '$(sonarServiceConnection)'
# scannerMode: 'CLI'
# configMode: 'manual'
# cliProjectKey: '$(ProjectKey)'
# - stage: SonarQualityGateCheck
# jobs:
# - job: SonarQualityGateCheckJob
# displayName: 'Sonar Quality Gate Check'
# steps:
# - checkout: self
# # Run SonarQube quality gate check using Bash script
# - script: |
# set -x
# username="$(username)"
# password="$(password)"
# base64AuthInfo=$(echo -n "$username:$password" | base64)
# headers=(
# "Authorization: Basic $base64AuthInfo"
# )
# projectKey="$(ProjectKey)"
# branch="master"
# apiUrl="http://20.15.204.13:9000/api/qualitygates/project_status?projectKey=$projectKey&branch=$branch"
# result=$(curl -s -H "${headers[@]}" "$apiUrl")
# if [[ $(echo "$result" | jq -r .projectStatus.status) == "OK" ]]; then
# echo "Quality Gate Succeeded"
# else
# echo "Quality gate failed"
# exit 1
# fi
# - stage: BuildAndPush
# displayName: 'Build and Push to ACR'
# jobs:
# - job: Build
# displayName: 'Build and Push'
# steps:
# - checkout: self
# - task: Docker@2
# displayName: 'Build and push Docker image'
# inputs:
# command: 'buildAndPush'
# containerRegistry: '$(AcrServiceConnection)'
# repository: 'testing'
# Dockerfile: '$(Build.SourcesDirectory)/Dockerfile'
# tags: |
# $(Build.BuildId)
# - task: CopyFiles@2
# displayName: 'Copy Files to: drop'
# inputs:
# SourceFolder: deployment
# Contents: deployment.yaml
# TargetFolder: drop
# - task: PublishBuildArtifacts@1
# displayName: 'Publish Artifact: drop'
# inputs:
# PathtoPublish: deployment/deployment.yaml