-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.json
More file actions
220 lines (219 loc) · 9.26 KB
/
commands.json
File metadata and controls
220 lines (219 loc) · 9.26 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "github.schema.json#",
"title": "List of Commands",
"description": "A list of frequently-used commands for each Sourcegraph deployment type.",
"allowComments": true,
"type": "object",
"additionalProperties": false,
"Docker": {
"Function": {
"value": "Function",
"command": "[CHOOSE FUNCTION]",
"description": "Default option"
},
"Get Logs": {
"command": "docker logs",
"option": "$CONTAINER",
"description": "Get the logs of a container."
},
"List Containers": {
"command": "docker ps -A",
"option": "",
"description": "Get a list of containers."
},
"Install or Start Sourcegraph": {
"command": "docker run -d --publish 7080:7080 --publish 127.0.0.1:3370:3370 --rm --volume ~/.sourcegraph/config:/etc/sourcegraph --volume ~/.sourcegraph/data:/var/opt/sourcegraph sourcegraph/server:",
"option": "$VERSION",
"description": "The docker run command first creates a writeable container layer over the specified image, and then starts it using the specified command."
},
"Upgrade Sourcegraph": {
"command": "docker run -d --publish 7080:7080 --publish 127.0.0.1:3370:3370 --rm --volume ~/.sourcegraph/config:/etc/sourcegraph --volume ~/.sourcegraph/data:/var/opt/sourcegraph sourcegraph/server:",
"option": "$VERSION",
"description": "All you need to do to upgrade Sourcegraph is to restart your Docker server with a new image tag."
},
"Run Bash Shell": {
"command": "docker exec -it",
"option": "$CONTAINER",
"command2": "bash",
"description": "This allows you to execute an interactive bash shell on a running container."
},
"Access pgsql database": {
"command": "docker container exec -it",
"option": "$CONTAINER",
"command2": "psql -U postgres sourcegraph",
"description": "This allows you to access the main database and run psql commands on a running container."
},
"Kill Container": {
"command": "docker kill",
"option": "$CONTAINER",
"description": "Kill one or more running containers (SIGKILL)"
},
"Stop Container" : {
"command": "docker stop",
"option": "$CONTAINER",
"description": "Stop one or more running containers (SIGTERM)"
},
"Start Container": {
"command": "docker start",
"option": "$CONTAINER",
"description": "Start a container."
},
"Restart Container": {
"command": "docker restart",
"option": "$CONTAINER",
"description": "Stop and start a container in one command."
},
"Run Interactive Shell": {
"command": "docker exec -it",
"option": "$CONTAINER",
"command2": "shell",
"description": "This allows you to execute an interactive shell on a running container."
}
},
"Docker Compose": {
"Function": {
"value": "Function",
"command": "[CHOOSE FUNCTION]",
"description": "Default option"
},
"Get Logs": {
"command": "docker compose logs",
"option": "$CONTAINER",
"description": "Get the logs of a container."
},
"List Containers": {
"command": "docker compose ps -a",
"option": "",
"description": "Get a list of containers."
},
"Kill Containers": {
"command": "docker compose kill",
"option": "",
"description": "Get a list of containers."
},
"Start Sourcegraph": {
"command": "docker compose up -d",
"option": "",
"description": "Builds, (re)creates, starts, and attaches to containers for Sourcegraph. `-d` flag starts the container in the detached mode where the container runs in the background."
},
"Shutdown Sourcegraph": {
"command": "docker compose down",
"option": "",
"description": "Stops containers and removes containers, networks, volumes, and images created by docker up."
},
"Run Bash Shell": {
"command": "docker compose exec -it",
"option": "$CONTAINER",
"command2": "bash",
"description": "This allows you to execute an interactive bash shell on a running container."
},
"Access frontend or codeintel DB postgres shell": {
"command": "docker compose exec -it",
"option": "$CONTAINER",
"command2": "psql -U sg",
"description": "Access the postgres shell for the frontend or code-intel databases."
},
"Access Codeinsights DB postgres shell": {
"command": "docker compose exec -it",
"option": "$CONTAINER",
"command2": "psql -U postgres",
"description": "Access the postgres shell for the code insights database"
},
"Generate the database dumps": {
"command": "docker compose exec pgsql sh -c 'pg_dump -C --username sg sg' > sourcegraph_db.out",
"option": "",
"description": "This allows you to generate the database dumps for the main database. Replace pgsql to codeintel-db for codeintel-db."
}
},
"Kubernetes": {
"Function": {
"value": "Function",
"command": "[CHOOSE FUNCTION]",
"description": "Default option"
},
"Get Logs": {
"command": "kubectl logs",
"option": "$POD",
"description": "Get the logs of a specified pod."
},
"List Pods": {
"command": "kubectl get pods -A",
"option": "",
"description": "Get a list of pods within the cluster and their health status."
},
"Describe Pod": {
"command": "kubectl describe pod",
"option": "$POD",
"description": "Display detailed information about the status of a single pod"
},
"Restart Sourcegraph": {
"command": "kubectl rollout restart deployment/sourcegraph-frontend",
"option": "$POD",
"description": "Restart Sourcegraph Instance by restarting the frontend pod."
},
"Get Events": {
"command": "kubectl get events",
"option": "",
"description": "List all events in the cluster’s history."
},
"Delete a Pod": {
"command": "kubectl delete pod",
"option": "$POD",
"description": "Delete a failing pod so that it will get recreated, possibly on a different node."
},
"List Persistent Volume Claims (PVCs)": {
"command": "kubectl get pvc",
"option": "",
"description": "List all Persistent Volume Claims (PVCs) and their statuses."
},
"List Persistent Volumes (PVs)": {
"command": "kubectl get pv",
"option": "",
"description": "List all Persistent Volumes (PVs) that have been provisioned."
},
"Port Forward Sourcegraph Frontend": {
"command": "kubectl port-forward svc/sourcegraph-frontend 3080:30080",
"option": "",
"description": "This allows you to access your deployed Sourcegraph instance locally."
},
"Run Interactive Shell": {
"command": "kubectl exec -it",
"option": "$POD",
"command2": " -- sh",
"description": "This allows you to execute an interactive shell on a Pod."
},
"Exec into frontend or codeintel database": {
"command": "kubectl exec -it",
"option": "$DB_NAME",
"command2": "-- psql -U sg",
"description": "Access the postgres shell for the frontend or code intel databases."
},
"Exec into code insights database": {
"command": "kubectl exec -it",
"option": "$DB_NAME",
"command2": "-- psql -U sg",
"description": "Access the postgres shell for the code insights databases."
},
"Stop existing deployment": {
"command": "kubectl scale --replicas=0 deployment/sourcegraph-frontend",
"option": "",
"description": "Stop the existing deployment by removing the frontend."
},
"Show pod metrics": {
"command": "kubectl top pod -- containers",
"option": "$POD",
"description": "This allows you to show metrics for a given pod and it's containers."
},
"Check Storage Class": {
"command":"kubectl get storage class",
"option": "",
"description":"This allows you to check the existence of a storage class and it's name."
},
"List container images": {
"command":"kubectl get pods -o jsonpath='{.items[*].spec.containers[*].image}'",
"option": "",
"description":"List the container images running in the cluster."
}
}
}