From a800e54d91b11fe21cf774e10c5b2c7cf897d2e7 Mon Sep 17 00:00:00 2001 From: Jay Sharma Date: Wed, 10 Jan 2024 03:17:47 +0000 Subject: [PATCH] Merged in bugfix/fixlogcheck (pull request #15) Fix validation for logs * Fix validation for logs Approved-by: Rachit Bhargava --- common-jobs-bitbucket.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/common-jobs-bitbucket.sh b/common-jobs-bitbucket.sh index 42243818..4b3b6158 100644 --- a/common-jobs-bitbucket.sh +++ b/common-jobs-bitbucket.sh @@ -105,7 +105,7 @@ git push && echo ---git-push-done--- ' kubectl delete po common-job-pod -n $NAMESPACE -cat script.log | egrep -v "Errors:|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt +cat script.log | egrep -v "Errors:|inflating|adding|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt ;; @@ -125,7 +125,7 @@ kubectl exec common-job-pod -n $NAMESPACE -- sh -c '. /tmp/setenv.sh; cd /tmp && kubectl delete po common-job-pod -n $NAMESPACE # ------------------------------------------------------------------------------------------------------------------------- -cat script.log | egrep -v "Errors:|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt +cat script.log | egrep -v "Errors:|inflating|adding|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt ;; @@ -153,7 +153,7 @@ curl --request POST -F files=@"$FILE" --url "https://api.bitbucket.org/2.0/repo kubectl delete po common-job-pod -n $NAMESPACE -cat script.log | egrep -v "Errors:|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt +cat script.log | egrep -v "Errors:|inflating|adding|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt ;; @@ -165,12 +165,12 @@ kubectl cp setenv.sh $NAMESPACE/common-job-pod:/tmp/setenv.sh kubectl exec common-job-pod -n $NAMESPACE -- sh -c 'chmod 755 /tmp/setenv.sh' kubectl exec common-job-pod -n $NAMESPACE -- apt update kubectl exec common-job-pod -n $NAMESPACE -- apt install wget zip unzip curl -y -kubectl exec common-job-pod -n $NAMESPACE -- sh -c '. /tmp/setenv.sh;cd /usr/share/nginx/subdomain/$SUBDOMAIN/wp-content/uploads;zip -r /tmp/upload.zip .' +kubectl exec common-job-pod -n $NAMESPACE -- sh -c '. /tmp/setenv.sh;cd /usr/share/nginx/subdomain/$SUBDOMAIN/wp-content/uploads;zip -r /tmp/upload.zip . -x "./wc-logs/*.log"' kubectl cp $NAMESPACE/common-job-pod:/tmp/upload.zip $NAMESPACE-$VERSION-$ENV-$SUBDOMAIN-$(date +%Y-%m-%dT%H_%M_%S).zip FILE=`ls $NAMESPACE-*.zip` aws s3 cp $FILE s3://commonjobs/$NAMESPACE/$opt/ kubectl delete po common-job-pod -n $NAMESPACE -cat script.log | egrep -v "Errors:|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt +cat script.log | egrep -v "Errors:|inflating|adding|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt ;; mysql-restore) @@ -237,7 +237,7 @@ fi kubectl exec common-job-pod -n $NAMESPACE -- sh -c '. /tmp/setenv.sh; wp search-replace --allow-root --path=/tmp/wp "http://$NEW_URL" "https://$NEW_URL" --all-tables' kubectl delete po common-job-pod -n $NAMESPACE -cat script.log | egrep -v "Errors:|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt +cat script.log | egrep -v "Errors:|inflating|adding|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt ;; @@ -259,15 +259,13 @@ kubectl exec common-job-pod -n $NAMESPACE -- sh -c '. /tmp/setenv.sh; mkdir -p / # ---------------------------------------------------------------------------------------------------------------------------------------------------- kubectl exec common-job-pod -n $NAMESPACE -- sh -c '. /tmp/setenv.sh; mkdir /tmp/uploads ;export FILE=`ls /tmp/*.zip`;unzip -o $FILE -d /tmp/uploads' kubectl exec common-job-pod -n $NAMESPACE -- sh -c '. /tmp/setenv.sh; rclone sync /tmp/uploads/ /usr/share/nginx/subdomain/$SUBDOMAIN/wp-content/uploads -q && echo ---sync-done--- ' -# ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------------------------------------------------------------------- kubectl exec common-job-pod -n $NAMESPACE -- sh -c '. /tmp/setenv.sh; mkdir /usr/share/nginx/subdomain/$SUBDOMAIN/wp-content/uploads/cache && echo ---CacheCreated---' -# ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- - +# -------------------------------------------------------------------------------------------------------------------------------------------- kubectl delete po common-job-pod -n $NAMESPACE -cat script.log | egrep -v "Errors:|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt +cat script.log | egrep -v "Errors:|inflating|adding|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt ;;