This repository was archived by the owner on Apr 13, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 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 () {
336336}
337337
338338function validate_file () {
339- echo " Validatng file $1 "
339+ echo " Validating file $1 "
340340 if grep -q " $2 " " $1 " ;
341341 then
342342 echo " File contents have been successfully validated in $1 "
@@ -535,3 +535,15 @@ function approve_pull_request () {
535535 exit 1
536536 fi
537537}
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
4040mono_repo_dir=fabrikam2019
4141helm_charts_dir=fabrikam-helm-charts
4242services_full_dir=" $TEST_WORKSPACE /$mono_repo_dir /$services_dir "
43+ FrontEndCompliant=" ${FrontEnd// ./ -} "
4344
4445shopt -s expand_aliases
4546alias spk=$SPK_LOCATION
@@ -316,6 +317,21 @@ echo "Attempting to approve pull request: '$pr_title'"
316317approve_pull_request $AZDO_ORG_URL $AZDO_PROJECT " $pr_title "
317318# --------------------------------
318319
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+
319335# ##################################
320336# TODO
321337# Fix issues where image tag update not reflected in manifest yaml
You can’t perform that action at this time.
0 commit comments