Commit 89d2245f authored by Koehorst, Jasper's avatar Koehorst, Jasper
Browse files

path preservation fix

parent 030136b5
......@@ -6,6 +6,7 @@
#date :2020
#version :0.0.1
#============================================================================
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#============================================================================
......@@ -18,20 +19,20 @@
kubectl get pods --namespace='unlock' | grep munlock-sync | grep Completed | awk '{print "kubectl -n unlock delete pod "$1}' | sh
# Get all possible nodes
kubectl get nodes | awk '{print $1}' | grep -v NAME > nodes.txt
kubectl get nodes | awk '{print $1}' | grep -v NAME > $DIR/nodes.txt
# For each node perform the sync
while read node; do
echo "$node"
sed "s/HOSTNAME/$node/g" template_sync_cwl.yaml > $node\_cwl.yaml
sed "s/HOSTNAME/$node/g" template_sync_infrastructure.yaml > $node\_infrastructure.yaml
sed "s/HOSTNAME/$node/g" template_sync_references.yaml > $node\_references.yaml
kubectl apply -f $node\_cwl.yaml
kubectl apply -f $node\_infrastructure.yaml
kubectl apply -f $node\_references.yaml
sed "s/HOSTNAME/$node/g" $DIR/template_sync_cwl.yaml > $DIR/$node\_cwl.yaml
sed "s/HOSTNAME/$node/g" $DIR/template_sync_infrastructure.yaml > $DIR/$node\_infrastructure.yaml
sed "s/HOSTNAME/$node/g" $DIR/template_sync_references.yaml > $DIR/$node\_references.yaml
kubectl apply -f $DIR/$node\_cwl.yaml
kubectl apply -f $DIR/$node\_infrastructure.yaml
kubectl apply -f $DIR/$node\_references.yaml
# Cleanup
rm $node\_cwl.yaml $node\_infrastructure.yaml $node\_references.yaml
rm $DIR/$node\_cwl.yaml $DIR/$node\_infrastructure.yaml $DIR/$node\_references.yaml
done < nodes.txt
done < $DIR/nodes.txt
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment