Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 15a2178

Browse files
cppwfscorneil
andauthored
Script should not end terminal if not using bash (#5630)
* Script should not end terminal if not using bash If the user hit the exit 0 (when using source) and they did not use bash terminal would exit. The user would not know why the terminal exited. Updated script to just check to see if there is bash available. Set namespace to default if not specified Add additional instructions when not running in bash Document the use of the --namespace key namespace is no longer positional but requires a --namespace or -ns key * Update set-ver.sh Make scdf the default namespace [skip ci] --------- Co-authored-by: Corneil du Plessis <[email protected]>
1 parent 3790ad9 commit 15a2178

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

spring-cloud-dataflow-docs/src/main/asciidoc/appendix-local-k8s-development.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Since these scripts export environmental variable they need to be executes as in
7878

7979
[source,shell]
8080
....
81-
source ./k8s/use-mk-docker.sh test-ns postgresql rabbitmq
81+
source ./k8s/use-mk-docker.sh postgresql rabbitmq --namespace test-ns
8282
....
8383

8484
===== TMC or GKE Cluster in Cloud

src/deploy/k8s/set-ver.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ while [ "$1" != "" ]; do
6464
shift
6565
done
6666
echo "Namespace: $NS"
67+
if [ "$NS" = "" ]; then
68+
NS=scdf
69+
fi
6770
export NS
6871
if [ "$BROKER" != "" ]; then
6972
echo "BROKER: $BROKER"

src/deploy/k8s/use-mk-docker.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
#!/usr/bin/env bash
2-
(return 0 2>/dev/null) && sourced=1 || sourced=0
3-
if [ "$sourced" = "0" ]; then
4-
echo "This script must be invoked using: source $0 $*"
5-
exit 1
6-
fi
72
if [ -z "$BASH_VERSION" ]; then
8-
echo "This script requires Bash. Use: bash $0 $*"
9-
exit 0
3+
echo "This script requires Bash. For example:\n bash \n $0 $*"
4+
else
5+
echo "Setting variables"
6+
SCDIR=$(readlink -f "${BASH_SOURCE[0]}")
7+
SCDIR=$(dirname "$SCDIR")
8+
SCDIR=$(realpath $SCDIR)
9+
source $SCDIR/use-mk.sh docker $*
1010
fi
11-
SCDIR=$(readlink -f "${BASH_SOURCE[0]}")
12-
SCDIR=$(dirname "$SCDIR")
13-
SCDIR=$(realpath $SCDIR)
14-
source $SCDIR/use-mk.sh docker $*

0 commit comments

Comments
 (0)