This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
smoke-test-pipeline.yml
254 lines (233 loc) · 9.72 KB
/
smoke-test-pipeline.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
trigger: none
schedules:
- cron: "0 0,1,17,18,19,20,21,22,23 * * Mon-Fri"
branches:
include: [master]
displayName: M-F 9:00AM to 5:00pm Hourly (UTC - 8:00) PST Builds
# Uncomment below if we want builds to run when the code has NOT changed
#always: true
variables:
skipComponentGovernanceDetection: "true"
stages:
- stage: integration_tests
jobs:
- job: introspection_onboard_integration_test
variables:
- group: "bedrock-cli-vg"
pool:
vmImage: "Ubuntu 16.04"
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: "specific"
project: $(BEDROCK_CLI_PROJECT_ID)
definition: $(BEDROCK_CLI_DEFINITION_ID)
buildVersionToDownload: "latestFromBranch"
branchName: "refs/heads/master"
itemPattern: "bedrock*"
artifactName: "bedrock_linux_node_12"
targetPath: "$(System.DefaultWorkingDirectory)"
- bash: |
shopt -s expand_aliases
echo "Current Dir is $(pwd)"
chmod +x bedrock-linux
alias bedrock="$(pwd)/bedrock-linux"
bedrock --version
displayName: "Verify Bedrock CLI downloaded and executable"
failOnStderr: true
- bash: |
echo "FUNC_SCRIPT: $FUNC_SCRIPT"
curl --fail $FUNC_SCRIPT > functions.sh
if [ $? -ne 0 ]; then
echo "Error finding FUNC_SCRIPT: $FUNC_SCRIPT"
exit 1
fi
chmod +x ./functions.sh
echo "TEST_SCRIPT3: $TEST_SCRIPT3"
curl --fail $TEST_SCRIPT3 > introspection-validations.sh
if [ $? -ne 0 ]; then
echo "Error finding TEST_SCRIPT3: $TEST_SCRIPT3"
exit 1
fi
chmod +x ./introspection-validations.sh
displayName: "Download integration test scripts"
env:
FUNC_SCRIPT: $(FUNC_SCRIPT)
TEST_SCRIPT: $(TEST_SCRIPT)
- bash: |
# Install the extension
export AZURE_DEVOPS_EXT_PAT=$(AZDO_PAT)
az extension add --name azure-devops
# Login to Azure
echo "az login --service-principal --username $(SP_APP_ID) --password $(SP_PASS) --tenant $(SP_TENANT)"
az login --service-principal --username "$(SP_APP_ID)" --password "$(SP_PASS)" --tenant "$(SP_TENANT)"
# Step up git identity
git config --global user.email "[email protected]"
git config --global user.name "Service Account"
# Set ENV VARs
export BEDROCK_CLI_LOCATION="$(pwd)/bedrock-linux"
export ACCESS_TOKEN_SECRET=$(AZDO_PAT)
export SP_PASS=$(SP_PASS)
export SP_TENANT=$(SP_TENANT)
# Include dependent scripts
. ./functions.sh
# Run the test
bash ./introspection-validations.sh
# Get exit status
status=$?
[ $status -eq 0 ] && echo "Test Done!" || (echo "Test had issues" && exit 1)
displayName: "Run Introspection onboard Validation Tests"
timeoutInMinutes: 15
- job: rings_integration_tests
variables:
- group: "bedrock-cli-vg"
pool:
vmImage: "Ubuntu 16.04"
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: "specific"
project: $(BEDROCK_CLI_PROJECT_ID)
definition: $(BEDROCK_CLI_DEFINITION_ID)
buildVersionToDownload: "latestFromBranch"
branchName: "refs/heads/master"
itemPattern: "bedrock*"
artifactName: "bedrock_linux_node_12"
targetPath: "$(System.DefaultWorkingDirectory)"
- bash: |
shopt -s expand_aliases
echo "Current Dir is $(pwd)"
chmod +x bedrock-linux
alias bedrock="$(pwd)/bedrock-linux"
bedrock --version
displayName: "Verify BEDROCK_CLI downloaded and executable"
failOnStderr: true
- bash: |
echo "FUNC_SCRIPT: $FUNC_SCRIPT"
curl --fail $FUNC_SCRIPT > functions.sh
if [ $? -ne 0 ]; then
echo "Error finding FUNC_SCRIPT: $FUNC_SCRIPT"
exit 1
fi
chmod +x ./functions.sh
echo "TEST_SCRIPT: $TEST_SCRIPT"
curl --fail $TEST_SCRIPT > validations.sh
if [ $? -ne 0 ]; then
echo "Error finding TEST_SCRIPT: $TEST_SCRIPT"
exit 1
fi
chmod +x ./validations.sh
displayName: "Download integration test scripts"
env:
FUNC_SCRIPT: $(FUNC_SCRIPT)
TEST_SCRIPT: $(TEST_SCRIPT)
- bash: |
# Install the extension
export AZURE_DEVOPS_EXT_PAT=$(AZDO_PAT)
az extension add --name azure-devops
# Login to Azure
echo "az login --service-principal --username $(SP_APP_ID) --password $(SP_PASS) --tenant $(SP_TENANT)"
az login --service-principal --username "$(SP_APP_ID)" --password "$(SP_PASS)" --tenant "$(SP_TENANT)"
# Step up git identity
git config --global user.email "[email protected]"
git config --global user.name "Service Account"
# Set ENV VARs
export BEDROCK_CLI_LOCATION="$(pwd)/bedrock-linux"
export ACCESS_TOKEN_SECRET=$(AZDO_PAT)
export SP_PASS=$(SP_PASS)
export SP_TENANT=$(SP_TENANT)
# Include dependent scripts
. ./functions.sh
mkdir helm-artifacts
cp ./tests/helm-artifacts/* helm-artifacts
# Run the test
bash ./validations.sh
# Get exit status
status=$?
[ $status -eq 0 ] && echo "Test Done!" || (echo "Test had issues" && exit 1)
displayName: "Run Validation Tests"
timeoutInMinutes: 25
- task: PublishPipelineArtifact@1
inputs:
path: $(System.DefaultWorkingDirectory)/bedrock-env/log.txt
artifact: test_logs
condition: always()
- job: infra_integration_tests
variables:
- group: "bedrock-cli-vg-infra"
pool:
vmImage: "Ubuntu 16.04"
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: "specific"
project: $(BEDROCK_CLI_PROJECT_ID)
definition: $(BEDROCK_CLI_DEFINITION_ID)
buildVersionToDownload: "latestFromBranch"
branchName: "refs/heads/master"
itemPattern: "bedrock*"
artifactName: "bedrock_linux_node_12"
targetPath: "$(System.DefaultWorkingDirectory)"
- bash: |
shopt -s expand_aliases
echo "Current Dir is $(pwd)"
chmod +x bedrock-linux
alias bedrock="$(pwd)/bedrock-linux"
bedrock --version
displayName: "Verify Bedrock CLI downloaded and executable"
failOnStderr: true
- bash: |
echo "FUNC_SCRIPT: $FUNC_SCRIPT"
curl $FUNC_SCRIPT > functions.sh
if [ $? -ne 0 ]; then
echo "Error finding FUNC_SCRIPT: $FUNC_SCRIPT"
exit 1
fi
chmod +x ./functions.sh
echo "TEST_SCRIPT2: $TEST_SCRIPT2"
curl $TEST_SCRIPT2 > infra-validations.sh
if [ $? -ne 0 ]; then
echo "Error finding TEST_SCRIPT2: $TEST_SCRIPT2"
exit 1
fi
chmod +x ./infra-validations.sh
echo "INFRA_YML: $INFRA_YML"
curl $INFRA_YML > infra-generation-pipeline.yml
if [ $? -ne 0 ]; then
echo "Error finding INFRA_YML: $INFRA_YML"
exit 1
fi
chmod +x ./infra-validations.sh
displayName: "Download integration test scripts"
env:
FUNC_SCRIPT: $(FUNC_SCRIPT)
TEST_SCRIPT2: $(TEST_SCRIPT2)
- bash: |
# Install the extension
export AZURE_DEVOPS_EXT_PAT=$(AZDO_PAT)
az extension add --name azure-devops
# Login to Azure
echo "az login --service-principal --username $(SP_APP_ID) --password $(SP_PASS) --tenant $(SP_TENANT)"
az login --service-principal --username "$(SP_APP_ID)" --password "$(SP_PASS)" --tenant "$(SP_TENANT)"
# Step up git identity
git config --global user.email "[email protected]"
git config --global user.name "Service Account"
# Set ENV VARs
export BEDROCK_CLI_LOCATION="$(pwd)/bedrock-linux"
export ACCESS_TOKEN_SECRET=$(AZDO_PAT)
export SP_PASS=$(SP_PASS)
export SP_TENANT=$(SP_TENANT)
# Include dependent scripts
. ./functions.sh
# Run the infra test
bash ./infra-validations.sh
# Get exit status
status=$?
[ $status -eq 0 ] && echo "Infra Test Done!" || (echo "Infra Test had issues" && exit 1)
displayName: "Run Infra Validation Tests"
timeoutInMinutes: 15
- task: PublishPipelineArtifact@1
inputs:
path: $(System.DefaultWorkingDirectory)/bedrock-env/log.txt
artifact: infra_test_logs
condition: always()