-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
110 lines (96 loc) · 3.09 KB
/
.bashrc
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export GOPATH=~/go_play
export PATH=$PATH:$GOPATH/bin
export GOBIN=~/go_play/bin
export CDPATH=.$GOPATH/src/github.com
source <(~/opencompose/bin/opencompose completion bash)
source <(~/kompose/bin/kompose completion bash)
source <(~/kedge/bin/kedge completion bash)
source <(~/odo/bin/odo completion bash)
source <(~/ark/bin/ark completion bash)
source <(minikube completion bash)
source <(helm completion bash)
source <(kubectl completion bash)
. /usr/share/git-core/contrib/completion/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
PROMPT_COMMAND=__prompt_command
__prompt_command() {
local EXIT="$?"
eval "$(direnv hook bash)"
PS1=""
##-ANSI-COLOR-CODES-##
No_Color="\[\033[0m\]"
###-Regular-###
Red="\[\033[0;31m\]"
Green="\[\033[0;32m\]"
Blue="\[\033[0;94m\]"
Purple="\[\033[0;95m\]"
Yellow="\[\033[0;33m\]"
####-Bold-####
BRed="\[\033[1;31m\]"
BGreen="\[\033[1;32m\]"
BBlue="\[\033[1;34m\]"
BPurple="\[\033[1;35m\]"
if [ $EXIT != 0 ]; then
PS1+="${Red}⛰ "
else
PS1+="${Green}⛰ "
fi
# oc project -q &> /dev/null
# if [ $? -eq 0 ]; then
# OC_PSI=" ${BRed}$(oc whoami)${Red}@${BRed}$(oc project -q)${No_Color} "
# fi
# PS1+="${Blue}\u${No_Color} ${Purple}\W${Yellow}$(__git_ps1 " (%s)")$OC_PSI$ ${No_Color}"
PS1+="${Blue}\u${No_Color} ${Purple}\W${Yellow}$(__git_ps1 " (%s)") $ ${No_Color}"
}
kube-switch-namespace() {
kubectl get namespace $1 &> /dev/null
if [ $? -eq 0 ]; then
echo "Switching to namespace: $1"
kubectl config set-context $(kubectl config current-context) --namespace=$1 > /dev/null
else
echo "Namespace: $1 does not exist"
kill -INT $$
fi
}
git-review-pull-request() {
# review_pull_request <pull request ID> <local branch name> <remote name>
if [ "$#" -eq 1 ]; then
echo "Setting local branch to $1"
local_branch=$1
echo "Setting remote to 'upstream'"
remote_name="upstream"
echo "Fetching pull request $1"
pull_id=$1
elif [ "$#" -eq 2 ]; then
echo "Setting local branch to $2"
local_branch=$2
echo "Setting remote to 'upstream'"
remote_name="upstream"
echo "Fetching pull request $1"
pull_id=$1
elif [ "$#" -eq 3 ]; then
echo "Setting local branch to $2"
local_branch=$2
echo "Setting remote to $3"
remote_name=$3
echo "Fetching pull request $1"
pull_id=$1
else
echo "Invalid syntax: use review_pull_request <pull request ID> <local branch name, optional> <remote name, optional>"
kill -INT $$
fi
echo "Running: git fetch $remote_name pull/$pull_id/head:$local_branch -f"
git fetch $remote_name pull/$pull_id/head:$local_branch -f
echo "Switching to branch '$local_branch'"
git checkout $local_branch
}
export ANSIBLE_NOCOWS=1
export MINISHIFT_ENABLE_EXPERIMENTAL=y
# added by travis gem
[ -f /home/concaf/.travis/travis.sh ] && source /home/concaf/.travis/travis.sh
export PATH=$PATH:~/.fabric8/bin
export PATH=/home/concaf/kubernetes/src/k8s.io/kubernetes/third_party/etcd:${PATH}
alias kkubectl=/home/concaf/kubernetes/src/k8s.io/kubernetes/cluster/kubectl.sh