Last active
June 19, 2020 17:11
-
-
Save nilesh93/3d720d05a62561c6277f824a0d2f881d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| api="$1" | |
| namespace="$2" | |
| insecure="$3" | |
| dir="$4" | |
| output="$(kubectl get api $api -n $namespace -o json | jq '.metadata.name' -r)" | |
| echo "$output" | |
| pwd | |
| ls -ll | |
| echo "creating missing dirs" | |
| mkdir -p $dir/Interceptors | |
| mkdir -p $dir/libs | |
| echo "print folder contents" | |
| ls -ll $dir/ | |
| if [ "$output" = "$api" ]; then | |
| echo "API exists in the system. Hence updaing the API" | |
| apictl update api -n $api -f $dir $insecure --namespace $namespace | |
| apictl import-api -f $dir -e k8s $insecure --update | |
| else | |
| echo "Adding API to the Kuberenetes" | |
| apictl add api -n $api $dir $insecure | |
| apictl import-api -f $dir -e k8s $insecure | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment