This repository was archived by the owner on Apr 13, 2020. It is now read-only.
File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ function verify_pipeline_with_poll () {
336
336
}
337
337
338
338
function validate_file () {
339
- echo " Validatng file $1 "
339
+ echo " Validating file $1 "
340
340
if grep -q " $2 " " $1 " ;
341
341
then
342
342
echo " File contents have been successfully validated in $1 "
@@ -535,3 +535,15 @@ function approve_pull_request () {
535
535
exit 1
536
536
fi
537
537
}
538
+
539
+ function validate_commit () {
540
+ commit_history=$( git --no-pager log --decorate=short --pretty=oneline -n1)
541
+ if [[ " $commit_history " == * " $1 " * ]]; then
542
+ echo " Commit Validated"
543
+ else
544
+ echo " Commit not validated. Retrying..."
545
+ sleep 10s
546
+ git pull
547
+ validate_commit $1
548
+ fi
549
+ }
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ services_dir=services
40
40
mono_repo_dir=fabrikam2019
41
41
helm_charts_dir=fabrikam-helm-charts
42
42
services_full_dir=" $TEST_WORKSPACE /$mono_repo_dir /$services_dir "
43
+ FrontEndCompliant=" ${FrontEnd// ./ -} "
43
44
44
45
shopt -s expand_aliases
45
46
alias spk=$SPK_LOCATION
@@ -316,6 +317,21 @@ echo "Attempting to approve pull request: '$pr_title'"
316
317
approve_pull_request $AZDO_ORG_URL $AZDO_PROJECT " $pr_title "
317
318
# --------------------------------
318
319
320
+ # #################################
321
+ # Manifest Validation Start
322
+ # #################################
323
+
324
+ echo " Validating image tag in manifest repo"
325
+ cd $TEST_WORKSPACE /$hld_dir
326
+ git pull
327
+ cd $mono_repo_dir /$FrontEndCompliant /master/config
328
+ image_repository=$( grep -A3 ' image:' common.yaml | tail -n3 | awk ' {print $2}' | head -n1 )
329
+ image_tag=$( grep -A3 ' image:' common.yaml | tail -n2 | awk ' {print $2}' | head -n 1)
330
+ cd $TEST_WORKSPACE /$manifests_dir
331
+ git pull
332
+ validate_commit $image_tag
333
+ validate_file " $TEST_WORKSPACE /$manifests_dir /prod/$mono_repo_dir /$FrontEndCompliant /master/chart.yaml" " image: $image_repository :$image_tag "
334
+
319
335
# ##################################
320
336
# TODO
321
337
# Fix issues where image tag update not reflected in manifest yaml
You can’t perform that action at this time.
0 commit comments