-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathws
More file actions
executable file
·52 lines (49 loc) · 2.17 KB
/
ws
File metadata and controls
executable file
·52 lines (49 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
function show_help() {
echo "Usage: ws up [options] | down [workspace] | clip (git (ssh | user) | docker (token | <user>))"
echo "ws"
echo " . clip"
echo " - git"
echo " - ssh ssh password for github access token to clipboard"
echo " - token githup cli access token to clipboard"
echo " - user github user name to clipboard"
echo " - password github user password to clipboard"
echo " - docker"
echo " - token dockerhub access token to clipboard"
echo " - user dockerhub user name to clipboard"
echo " - password dockerhub user password to clipboard"
echo " . up start a tmux workspace"
echo " . -k ... with a minikube k8s cluster active"
echo " - <namespace> ... set kubectl namespace, otherwise 'default'"
echo " . -o start an openshift local cluster"
echo " - <namespace> ... set kubectl namespace, otherwise 'default'"
echo " . help help text"
echo " . down shut down tmux workspace"
echo " . <workspace> ... with given name"
echo "-----------------------------------------------------------------------------------------"
echo "Note: '.' optional alternative parameter, '-' mandatory alternative parameters, <> user-defined text"
}
# set up the secrets for use in ws clip if we are not in a session.
# If we are in ws session, the secrets have been setup already
if ! { [ -n "$TMUX" ] && [ "$TERM" = "screen" ]; }; then
export DOCKERHUB_TOKEN=$(pass registries/dockerhub/tokens/build)
export DOCKERHUB_USER=rabaul
export DOCKERHUB_USER_PASSW=$(pass registries/dockerhub/rabaul)
export GITHUB_SSH_PASSW=$(pass repos/github/ssh/vivo_20240212_ed25519)
export GITHUB_CLI_TOKEN="$(pass repos/github/token)"
export GITHUB_USER=onouv
export GITHUB_USER_PASSW=$(pass repos/github/onouv)
fi
first=$1
shift
if ! [ -z $first ]; then
if [[ $first == up ]]; then
~/bin-src/wsup $*
elif [[ $first == down ]]; then
~/bin-src/wsdown $*
elif [[ $first == clip ]]; then
~/bin-src/clip $*
fi
else
show_help
fi