Merged in feature/schedule (pull request #43)

Add schedule

* Add schedule

* Merged develop into feature/schedule

Approved-by: Rachit Bhargava
This commit is contained in:
Jay Sharma
2024-03-06 20:42:13 +00:00
committed by Rachit Bhargava
parent f02b01d1af
commit ff5b56dc44
3 changed files with 210 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ exec > >(tee -a script.log) 2>&1
# Install the required packages #
# --------------------------------------------------------------
apk upgrade && apk add curl wget zip unzip
apk upgrade && apk add curl wget zip unzip coreutils
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x ./kubectl && mv ./kubectl /usr/local/bin/kubectl
@@ -77,6 +77,15 @@ deploy_version=$2
case $opt in
cleanup-backup)
aws eks update-kubeconfig --name caresage-eks-cluster-$ENV --region us-east-1 && . ./setenv.sh && chmod 755 ./s3cleanup.sh
./s3cleanup.sh && echo list-of-files-older-than-thirty-days-done || exit 9
cat script.log | egrep -v "Errors:|SQL|rewrite|Rewrite|warning|Warning|create mode" | egrep -i "not in gzip format|Permission denied|fail|fatal|exception|terminated|command not found|error|unexpected|cannot access|No such file" && exit 9 || echo VALIDATION_PASS_$opt
;;
wp-auto-patch)
# The auto patch to be executed for dev01 to be specific
@@ -288,9 +297,7 @@ 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:|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