-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
102 lines (88 loc) · 2.73 KB
/
.zshrc
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
autoload -Uz compinit
compinit
USER=${$(whoami):-'harrytang'}
export USER
alias harry='. ~/harrytang.sh'
#alias companya='. ~/CompanyA.sh'
#alias companyb='. ~/CompanyB.sh'
# Description: Aliases for devops-tools
## AWS CLI
alias aws='docker run --rm -ti -v ~/.aws:/root/.aws amazon/aws-cli'
## Oracle Cloud
alias oci='docker run --rm -it -v ~/.oci:/oracle/.oci ghcr.io/oracle/oci-cli'
## acme.sh
alias acme.sh='docker run --rm -it -v ~/.acme.sh:/acme.sh neilpang/acme.sh'
## node
alias node='docker run --rm -it \
-e WORKSPACE=${PWD} \
-e USER=${USER} \
-v ${PWD}:/workspace -v npm:/root/.npm \
-v ${USER}:/root \
-w /workspace ghcr.io/harrytang/devops-tools:node'
## npm
alias npm='docker run --rm -it \
-e WORKSPACE=${PWD} \
-e USER=${USER} \
-v ${PWD}:/workspace \
-v ${USER}:/root \
-w /workspace ghcr.io/harrytang/devops-tools:node npm'
## npx
alias npx='docker run --rm -it \
-e WORKSPACE=${PWD} \
-e USER=${USER} \
-v ${PWD}:/workspace \
-v ${USER}:/root \
-w /workspace ghcr.io/harrytang/devops-tools:node npx'
## php
alias php='docker run --rm -it \
-e WORKSPACE=${PWD} \
-e USER=${USER} \
-v ${PWD}:/workspace \
-v ${USER}:/root \
-w /workspace php:latest'
## kubeseal
alias kubeseal='docker run -it --rm \
-e WORKSPACE=${PWD} \
-e USER=${USER} \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:/workspace \
-v ${USER}:/root \
-w /workspace ghcr.io/harrytang/devops-tools:latest kubeseal'
## kubectl & helm
if [[ $(which kubectl) =~ "not found" ]]; then \
alias kubectl='docker run -it --rm \
-e WORKSPACE=${PWD} \
-e USER=${USER} \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:/workspace \
-v ${USER}:/root \
-w /workspace ghcr.io/harrytang/devops-tools:latest kubectl'; \
alias helm='docker run -it --rm \
-e WORKSPACE=${PWD} \
-e USER=${USER} \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:/workspace \
-v ${USER}:/root \
-w /workspace ghcr.io/harrytang/devops-tools:latest helm'; \
else source <(kubectl completion zsh); fi
## skaffold
alias skaffold='docker run -it --rm \
-e WORKSPACE=${PWD} \
-e USER=${USER} \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:/workspace \
-v ${USER}:/root \
-w /workspace ghcr.io/harrytang/devops-tools:latest skaffold'
## devops-tools
alias devops='docker run -it --rm \
-e WORKSPACE=${PWD} \
-e USER=${USER} \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:/workspace \
-v ${USER}:/root \
-w /workspace -P ghcr.io/harrytang/devops-tools:latest ssh-agent /bin/zsh'
alias dev='docker run -it --rm \
-e WORKSPACE=${PWD} \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:/workspace \
-w /workspace -P ghcr.io/harrytang/devops-tools:latest ssh-agent /bin/zsh'