Merged in feature/multidevfix (pull request #38)
Feature/multidevfix * multidev sync * multidev sync fix typo * Add conf for www and dev01 * Add conf for www and dev01 * fix typo * symlink fix * hpa and resource modify Approved-by: Rachit Bhargava
This commit is contained in:
committed by
Rachit Bhargava
parent
5b27e475cf
commit
ac0ffd7543
18
multidev-sync.sh
Normal file
18
multidev-sync.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
NAMESPACE=medicalalert-web
|
||||
|
||||
if [ "$ENV" = "dev" ]; then
|
||||
pods=`kubectl get pods --no-headers -o custom-columns=":metadata.name" -n $NAMESPACE`
|
||||
for i in $pods; do
|
||||
kubectl exec $i -n $NAMESPACE -- apt-key adv --fetch-keys 'https://packages.sury.org/php/apt.gpg' > /dev/null 2>&1
|
||||
kubectl exec $i -n $NAMESPACE -- apt-get update
|
||||
kubectl exec $i -n $NAMESPACE -- apt-get install rclone rsync -y
|
||||
kubectl exec $i -n $NAMESPACE -- sh -c 'for j in dev02 dev03 dev04 dev05; do cd /usr/share/nginx/subdomain && rclone sync --exclude wp-content/uploads/** $j/ /usr/share/nginx/subdomain/$j-web -q && echo ---sync-done from efs to local for $j-web --- && cd $j-web/wp-content && [ -L uploads ] && [ -e uploads ]] && echo ----symlink-exist--- || ln -s /usr/share/nginx/subdomain/$j/wp-content/uploads uploads && chown -R nginx:nginx /usr/share/nginx/subdomain/$j-web;done'
|
||||
|
||||
done
|
||||
else
|
||||
|
||||
echo ----The env is $ENV and thus no multidev applicable----
|
||||
|
||||
fi
|
||||
Reference in New Issue
Block a user