Merged in bugfix/fixlogcheck (pull request #15)

Fix validation for logs

* Fix validation for logs


Approved-by: Rachit Bhargava
This commit is contained in:
Jay Sharma
2024-01-10 03:17:47 +00:00
committed by Rachit Bhargava
parent 3a22fcaa4a
commit a800e54d91

View File

@@ -105,7 +105,7 @@ git push && echo ---git-push-done--- '
kubectl delete po common-job-pod -n $NAMESPACE 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 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 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 -- sh -c 'chmod 755 /tmp/setenv.sh'
kubectl exec common-job-pod -n $NAMESPACE -- apt update 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 -- 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 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` FILE=`ls $NAMESPACE-*.zip`
aws s3 cp $FILE s3://commonjobs/$NAMESPACE/$opt/ aws s3 cp $FILE s3://commonjobs/$NAMESPACE/$opt/
kubectl delete po common-job-pod -n $NAMESPACE 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) 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 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 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; 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; 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 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 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
;; ;;