devops33 0.5.0__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {devops33-0.5.0 → devops33-0.6.0}/PKG-INFO +1 -1
- devops33-0.6.0/devops/main.py +263 -0
- {devops33-0.5.0 → devops33-0.6.0}/devops33.egg-info/PKG-INFO +1 -1
- {devops33-0.5.0 → devops33-0.6.0}/pyproject.toml +1 -1
- devops33-0.5.0/devops/main.py +0 -188
- {devops33-0.5.0 → devops33-0.6.0}/LICENSE +0 -0
- {devops33-0.5.0 → devops33-0.6.0}/README.md +0 -0
- {devops33-0.5.0 → devops33-0.6.0}/devops/__init__.py +0 -0
- {devops33-0.5.0 → devops33-0.6.0}/devops/__main__.py +0 -0
- {devops33-0.5.0 → devops33-0.6.0}/devops33.egg-info/SOURCES.txt +0 -0
- {devops33-0.5.0 → devops33-0.6.0}/devops33.egg-info/dependency_links.txt +0 -0
- {devops33-0.5.0 → devops33-0.6.0}/devops33.egg-info/entry_points.txt +0 -0
- {devops33-0.5.0 → devops33-0.6.0}/devops33.egg-info/top_level.txt +0 -0
- {devops33-0.5.0 → devops33-0.6.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devops33
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: An interactive CLI tool for learning Docker, Git, Prometheus, and Kubernetes commands.
|
|
5
5
|
Author-email: DevOps Assistant <assistant@example.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/example/devops-lab-assistant
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
import time
|
|
4
|
+
|
|
5
|
+
# --- Subtle ANSI Color Palette ---
|
|
6
|
+
class Colors:
|
|
7
|
+
DIM = '\033[2m'
|
|
8
|
+
GREY = '\033[90m'
|
|
9
|
+
SOFT_BLUE = '\033[34m'
|
|
10
|
+
SOFT_CYAN = '\033[36m'
|
|
11
|
+
SOFT_GREEN = '\033[32m'
|
|
12
|
+
SOFT_YELLOW = '\033[33m'
|
|
13
|
+
BOLD = '\033[1m'
|
|
14
|
+
RESET = '\033[0m'
|
|
15
|
+
|
|
16
|
+
# --- Full Lab Guide Content ---
|
|
17
|
+
LAB_GUIDES = {
|
|
18
|
+
"Docker": """# =========================================================
|
|
19
|
+
# DOCKER LAB GUIDE
|
|
20
|
+
# =========================================================
|
|
21
|
+
|
|
22
|
+
STEP 1 — OPEN UBUNTU WSL
|
|
23
|
+
------------------------
|
|
24
|
+
wsl -d Ubuntu
|
|
25
|
+
|
|
26
|
+
STEP 2 — VERIFY DOCKER INSTALLED
|
|
27
|
+
-------------------------------
|
|
28
|
+
sudo docker --version
|
|
29
|
+
|
|
30
|
+
STEP 3 — TEST DOCKER WORKING
|
|
31
|
+
---------------------------
|
|
32
|
+
sudo docker run hello-world
|
|
33
|
+
|
|
34
|
+
Expected Output: 'Hello from Docker!'
|
|
35
|
+
|
|
36
|
+
STEP 4 — CHECK DOWNLOADED IMAGES
|
|
37
|
+
-------------------------------
|
|
38
|
+
sudo docker images
|
|
39
|
+
|
|
40
|
+
STEP 5 — CHECK ALL CONTAINERS
|
|
41
|
+
----------------------------
|
|
42
|
+
sudo docker ps -a
|
|
43
|
+
|
|
44
|
+
STEP 6 — PULL IMAGE FROM HUB
|
|
45
|
+
---------------------------
|
|
46
|
+
sudo docker pull nginx
|
|
47
|
+
|
|
48
|
+
STEP 7 — RUN NGINX CONTAINER
|
|
49
|
+
---------------------------
|
|
50
|
+
sudo docker run -d --name mynginx -p 8080:80 nginx
|
|
51
|
+
|
|
52
|
+
STEP 8 — STOP & REMOVE
|
|
53
|
+
---------------------
|
|
54
|
+
sudo docker stop mynginx
|
|
55
|
+
sudo docker rm mynginx
|
|
56
|
+
|
|
57
|
+
STEP 9 — CUSTOM IMAGE BUILD
|
|
58
|
+
--------------------------
|
|
59
|
+
mkdir ~/custom_image && cd ~/custom_image
|
|
60
|
+
echo "print('Custom Image')" > app.py
|
|
61
|
+
nano Dockerfile
|
|
62
|
+
sudo docker build -t mypythonapp .
|
|
63
|
+
sudo docker run --name mycontainer mypythonapp
|
|
64
|
+
|
|
65
|
+
STEP 10 — DOCKER HUB SYNC
|
|
66
|
+
------------------------
|
|
67
|
+
sudo docker login
|
|
68
|
+
sudo docker tag mypythonapp user/repo:v1
|
|
69
|
+
sudo docker push user/repo:v1
|
|
70
|
+
""",
|
|
71
|
+
"Git": """# =========================================================
|
|
72
|
+
# GIT & GITHUB WORKFLOW
|
|
73
|
+
# =========================================================
|
|
74
|
+
|
|
75
|
+
STEP 1 — INSTALLATION & SETUP
|
|
76
|
+
-----------------------------
|
|
77
|
+
sudo apt update && sudo apt upgrade -y
|
|
78
|
+
sudo apt install git -y
|
|
79
|
+
git --version
|
|
80
|
+
|
|
81
|
+
STEP 2 — CONFIGURATION
|
|
82
|
+
----------------------
|
|
83
|
+
git config --global user.name "Your Name"
|
|
84
|
+
git config --global user.email "your@email.com"
|
|
85
|
+
|
|
86
|
+
STEP 3 — REPO INITIALIZATION
|
|
87
|
+
----------------------------
|
|
88
|
+
mkdir devops_lab && cd devops_lab
|
|
89
|
+
git init
|
|
90
|
+
|
|
91
|
+
STEP 4 — TRACKING CHANGES
|
|
92
|
+
-------------------------
|
|
93
|
+
echo "print('Hello')" > app.py
|
|
94
|
+
git status
|
|
95
|
+
git add .
|
|
96
|
+
git commit -m "Initial commit"
|
|
97
|
+
|
|
98
|
+
STEP 5 — REMOTE CONNECTION
|
|
99
|
+
--------------------------
|
|
100
|
+
git remote add origin https://github.com/user/repo.git
|
|
101
|
+
git branch -M main
|
|
102
|
+
git push -u origin main
|
|
103
|
+
|
|
104
|
+
STEP 6 — DAILY WORKFLOW
|
|
105
|
+
-----------------------
|
|
106
|
+
git status
|
|
107
|
+
git add .
|
|
108
|
+
git commit -m "update"
|
|
109
|
+
git push
|
|
110
|
+
""",
|
|
111
|
+
"Prometheus & Utils": """# =========================================================
|
|
112
|
+
# PROMETHEUS & GRAFANA STACK
|
|
113
|
+
# =========================================================
|
|
114
|
+
|
|
115
|
+
STEP 1 — PROJECT SETUP
|
|
116
|
+
----------------------
|
|
117
|
+
mkdir ~/prom_lab && cd ~/prom_lab
|
|
118
|
+
|
|
119
|
+
STEP 2 — CONFIGURATION FILES
|
|
120
|
+
---------------------------
|
|
121
|
+
nano prometheus.yml
|
|
122
|
+
nano docker-compose.yml
|
|
123
|
+
|
|
124
|
+
STEP 3 — DEPLOY STACK
|
|
125
|
+
---------------------
|
|
126
|
+
sudo docker compose up -d
|
|
127
|
+
sudo docker ps
|
|
128
|
+
|
|
129
|
+
STEP 4 — VERIFY METRICS
|
|
130
|
+
----------------------
|
|
131
|
+
Check http://localhost:9090 (Prometheus)
|
|
132
|
+
Check http://localhost:3000 (Grafana)
|
|
133
|
+
|
|
134
|
+
STEP 5 — CLEANUP
|
|
135
|
+
---------------
|
|
136
|
+
sudo docker compose down
|
|
137
|
+
""",
|
|
138
|
+
"Kubernetes": """# =========================================================
|
|
139
|
+
# KUBERNETES (K8S) MINI-LAB
|
|
140
|
+
# =========================================================
|
|
141
|
+
|
|
142
|
+
STEP 1 — START CLUSTER
|
|
143
|
+
----------------------
|
|
144
|
+
minikube start
|
|
145
|
+
minikube status
|
|
146
|
+
|
|
147
|
+
STEP 2 — POD OPERATIONS
|
|
148
|
+
-----------------------
|
|
149
|
+
kubectl run my-pod --image=nginx
|
|
150
|
+
kubectl get pods
|
|
151
|
+
kubectl get pod my-pod -o wide
|
|
152
|
+
|
|
153
|
+
STEP 3 — SERVICES & ACCESS
|
|
154
|
+
--------------------------
|
|
155
|
+
kubectl expose pod my-pod --type=NodePort --port=80
|
|
156
|
+
minikube service my-pod --url
|
|
157
|
+
|
|
158
|
+
STEP 4 — DEPLOYMENTS & SCALING
|
|
159
|
+
------------------------------
|
|
160
|
+
kubectl create deployment my-deploy --image=nginx --replicas=2
|
|
161
|
+
kubectl get deployment
|
|
162
|
+
kubectl scale deployment my-deploy --replicas=5
|
|
163
|
+
|
|
164
|
+
STEP 5 — CLEANUP
|
|
165
|
+
---------------
|
|
166
|
+
kubectl delete service my-service
|
|
167
|
+
kubectl delete deployment my-deploy
|
|
168
|
+
minikube stop
|
|
169
|
+
"""
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
def clear_screen():
|
|
173
|
+
os.system('cls' if os.name == 'nt' else 'clear')
|
|
174
|
+
|
|
175
|
+
def print_banner():
|
|
176
|
+
banner = f"""
|
|
177
|
+
{Colors.GREY}{Colors.BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
178
|
+
DEVOPS WORKFLOW SEQUENCER
|
|
179
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━{Colors.RESET}
|
|
180
|
+
"""
|
|
181
|
+
print(banner)
|
|
182
|
+
|
|
183
|
+
def print_all_commands():
|
|
184
|
+
clear_screen()
|
|
185
|
+
print_banner()
|
|
186
|
+
print(f"{Colors.SOFT_CYAN}Initializing full master workflow sequence...{Colors.RESET}\n")
|
|
187
|
+
time.sleep(0.5)
|
|
188
|
+
|
|
189
|
+
for category, guide in LAB_GUIDES.items():
|
|
190
|
+
print(f"\n{Colors.BOLD}{Colors.SOFT_BLUE}[ {category.upper()} MODULE ]{Colors.RESET}")
|
|
191
|
+
print(f"{Colors.GREY}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━{Colors.RESET}")
|
|
192
|
+
format_and_print_guide(guide)
|
|
193
|
+
time.sleep(0.3)
|
|
194
|
+
|
|
195
|
+
print(f"\n{Colors.SOFT_GREEN}✓ All sequences loaded.{Colors.RESET}")
|
|
196
|
+
input(f"\n{Colors.GREY}Return to control center...{Colors.RESET}")
|
|
197
|
+
|
|
198
|
+
def format_and_print_guide(guide):
|
|
199
|
+
"""Helper to add some color to the embedded markdown guides."""
|
|
200
|
+
for line in guide.split('\n'):
|
|
201
|
+
if line.startswith('#'):
|
|
202
|
+
print(f"{Colors.BOLD}{Colors.SOFT_CYAN}{line}{Colors.RESET}")
|
|
203
|
+
elif 'STEP' in line:
|
|
204
|
+
print(f"{Colors.SOFT_YELLOW}{line}{Colors.RESET}")
|
|
205
|
+
elif line.startswith('---') or line.startswith('==='):
|
|
206
|
+
print(f"{Colors.GREY}{line}{Colors.RESET}")
|
|
207
|
+
elif any(cmd in line for cmd in ['sudo', 'docker', 'git', 'kubectl', 'minikube']):
|
|
208
|
+
print(f" {Colors.SOFT_GREEN}{line}{Colors.RESET}")
|
|
209
|
+
else:
|
|
210
|
+
print(f" {Colors.DIM}{line}{Colors.RESET}")
|
|
211
|
+
|
|
212
|
+
def show_category(category):
|
|
213
|
+
clear_screen()
|
|
214
|
+
print_banner()
|
|
215
|
+
print(f"{Colors.SOFT_CYAN}Loading full {category} lab sequence...{Colors.RESET}\n")
|
|
216
|
+
time.sleep(0.3)
|
|
217
|
+
|
|
218
|
+
format_and_print_guide(LAB_GUIDES[category])
|
|
219
|
+
|
|
220
|
+
print(f"\n{Colors.SOFT_GREEN}✓ Sequence ready.{Colors.RESET}")
|
|
221
|
+
input(f"\n{Colors.GREY}Return to control center...{Colors.RESET}")
|
|
222
|
+
|
|
223
|
+
def main():
|
|
224
|
+
while True:
|
|
225
|
+
clear_screen()
|
|
226
|
+
print_banner()
|
|
227
|
+
print(f"{Colors.DIM}Select operational module:{Colors.RESET}")
|
|
228
|
+
print(f"{Colors.SOFT_CYAN}01.{Colors.RESET} Docker Services")
|
|
229
|
+
print(f"{Colors.SOFT_CYAN}02.{Colors.RESET} Git Workflow")
|
|
230
|
+
print(f"{Colors.SOFT_CYAN}03.{Colors.RESET} Prometheus & Utilities")
|
|
231
|
+
print(f"{Colors.SOFT_CYAN}04.{Colors.RESET} Kubernetes Cluster")
|
|
232
|
+
print(f"{Colors.SOFT_CYAN}05.{Colors.RESET} {Colors.BOLD}Sequential Workflow Listing{Colors.RESET}")
|
|
233
|
+
print(f"{Colors.GREY}06.{Colors.RESET} Exit System")
|
|
234
|
+
|
|
235
|
+
choice = input(f"\n{Colors.SOFT_YELLOW}cmd_select >> {Colors.RESET}")
|
|
236
|
+
|
|
237
|
+
if choice in ['1', '01']:
|
|
238
|
+
show_category("Docker")
|
|
239
|
+
elif choice in ['2', '02']:
|
|
240
|
+
show_category("Git")
|
|
241
|
+
elif choice in ['3', '03']:
|
|
242
|
+
show_category("Prometheus & Utils")
|
|
243
|
+
elif choice == '4' or choice == '04':
|
|
244
|
+
show_category("Kubernetes")
|
|
245
|
+
elif choice == '5' or choice == '05':
|
|
246
|
+
print_all_commands()
|
|
247
|
+
elif choice == '6' or choice == '06':
|
|
248
|
+
print(f"\n{Colors.SOFT_GREEN}System shutdown initiated...{Colors.RESET}")
|
|
249
|
+
time.sleep(0.8)
|
|
250
|
+
break
|
|
251
|
+
else:
|
|
252
|
+
print(f"\n{Colors.SOFT_YELLOW}Command unrecognized.{Colors.RESET}")
|
|
253
|
+
time.sleep(1)
|
|
254
|
+
|
|
255
|
+
def run():
|
|
256
|
+
try:
|
|
257
|
+
main()
|
|
258
|
+
except KeyboardInterrupt:
|
|
259
|
+
print(f"\n\n{Colors.GREY}Process terminated by user.{Colors.RESET}")
|
|
260
|
+
sys.exit(0)
|
|
261
|
+
|
|
262
|
+
if __name__ == "__main__":
|
|
263
|
+
run()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devops33
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: An interactive CLI tool for learning Docker, Git, Prometheus, and Kubernetes commands.
|
|
5
5
|
Author-email: DevOps Assistant <assistant@example.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/example/devops-lab-assistant
|
devops33-0.5.0/devops/main.py
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import sys
|
|
3
|
-
import time
|
|
4
|
-
|
|
5
|
-
# --- Subtle ANSI Color Palette ---
|
|
6
|
-
class Colors:
|
|
7
|
-
DIM = '\033[2m'
|
|
8
|
-
GREY = '\033[90m'
|
|
9
|
-
SOFT_BLUE = '\033[34m'
|
|
10
|
-
SOFT_CYAN = '\033[36m'
|
|
11
|
-
SOFT_GREEN = '\033[32m'
|
|
12
|
-
SOFT_YELLOW = '\033[33m'
|
|
13
|
-
BOLD = '\033[1m'
|
|
14
|
-
RESET = '\033[0m'
|
|
15
|
-
|
|
16
|
-
# --- Command Data ---
|
|
17
|
-
COMMANDS = {
|
|
18
|
-
"Docker": [
|
|
19
|
-
{"cmd": "wsl -d Ubuntu", "desc": "Opens the Ubuntu WSL distribution from PowerShell."},
|
|
20
|
-
{"cmd": "sudo docker --version", "desc": "Verifies if Docker is installed and shows the version."},
|
|
21
|
-
{"cmd": "sudo docker run hello-world", "desc": "Tests if Docker is working correctly by running a test container."},
|
|
22
|
-
{"cmd": "sudo docker images", "desc": "Lists all Docker images currently downloaded on your system."},
|
|
23
|
-
{"cmd": "sudo docker ps -a", "desc": "Shows all containers, including those that are currently stopped."},
|
|
24
|
-
{"cmd": "sudo docker pull nginx", "desc": "Downloads the official Nginx image from Docker Hub."},
|
|
25
|
-
{"cmd": "sudo docker run -d --name mynginx -p 8080:80 nginx", "desc": "Runs Nginx in detached mode with port mapping."},
|
|
26
|
-
{"cmd": "sudo docker ps", "desc": "Lists currently running containers."},
|
|
27
|
-
{"cmd": "sudo docker stop mynginx", "desc": "Stops a running container named 'mynginx'."},
|
|
28
|
-
{"cmd": "sudo docker rm mynginx", "desc": "Permanently removes a stopped container named 'mynginx'."},
|
|
29
|
-
{"cmd": "mkdir ~/custom_image", "desc": "Creates a new project directory for a custom Docker image."},
|
|
30
|
-
{"cmd": "cd ~/custom_image", "desc": "Changes directory into the project folder."},
|
|
31
|
-
{"cmd": "echo \"print('...')\" > app.py", "desc": "Creates a simple Python application file."},
|
|
32
|
-
{"cmd": "cat app.py", "desc": "Displays the contents of the Python application file."},
|
|
33
|
-
{"cmd": "nano Dockerfile", "desc": "Opens the nano editor to create or edit a Dockerfile."},
|
|
34
|
-
{"cmd": "cat Dockerfile", "desc": "Displays the contents of the Dockerfile."},
|
|
35
|
-
{"cmd": "sudo docker build -t mypythonapp .", "desc": "Builds a custom Docker image from the local Dockerfile."},
|
|
36
|
-
{"cmd": "sudo docker run --name mycontainer mypythonapp", "desc": "Runs a container from your custom built image."},
|
|
37
|
-
{"cmd": "sudo docker logs mycontainer", "desc": "Displays the output logs from a specific container."},
|
|
38
|
-
{"cmd": "sudo docker login", "desc": "Authenticates your local client with your Docker Hub account."},
|
|
39
|
-
{"cmd": "sudo docker tag mypythonapp user/app:v1", "desc": "Tags an image for uploading to Docker Hub."},
|
|
40
|
-
{"cmd": "sudo docker push user/app:v1", "desc": "Uploads the tagged image to Docker Hub."},
|
|
41
|
-
{"cmd": "sudo docker rmi mypythonapp", "desc": "Removes a local Docker image from your system."}
|
|
42
|
-
],
|
|
43
|
-
"Git": [
|
|
44
|
-
{"cmd": "sudo apt update", "desc": "Updates the local package list for the latest software info."},
|
|
45
|
-
{"cmd": "sudo apt upgrade -y", "desc": "Upgrades all installed packages to their latest versions."},
|
|
46
|
-
{"cmd": "git --version", "desc": "Checks the currently installed Git version."},
|
|
47
|
-
{"cmd": "sudo apt install git -y", "desc": "Installs the Git version control system."},
|
|
48
|
-
{"cmd": "cd ~", "desc": "Navigates to the Linux user's home directory."},
|
|
49
|
-
{"cmd": "mkdir devops_lab", "desc": "Creates a new folder for the DevOps lab project."},
|
|
50
|
-
{"cmd": "cd devops_lab", "desc": "Enters the project folder."},
|
|
51
|
-
{"cmd": "pwd", "desc": "Prints the absolute path of the current working directory."},
|
|
52
|
-
{"cmd": "git init", "desc": "Initializes a new Git repository in the current folder."},
|
|
53
|
-
{"cmd": "echo \"print('...')\" > app.py", "desc": "Creates a Python file for the Git lab."},
|
|
54
|
-
{"cmd": "ls", "desc": "Lists the files in the current directory."},
|
|
55
|
-
{"cmd": "cat app.py", "desc": "Views the contents of the application file."},
|
|
56
|
-
{"cmd": "git status", "desc": "Shows the state of tracked and untracked files."},
|
|
57
|
-
{"cmd": "git config --global user.name 'Name'", "desc": "Sets your Git username globally."},
|
|
58
|
-
{"cmd": "git config --global user.email 'Email'", "desc": "Sets your Git email address globally."},
|
|
59
|
-
{"cmd": "git add app.py", "desc": "Stages a specific file for the next commit."},
|
|
60
|
-
{"cmd": "git add .", "desc": "Stages all changes in the current directory."},
|
|
61
|
-
{"cmd": "git commit -m 'message'", "desc": "Commits staged changes to the repository history."},
|
|
62
|
-
{"cmd": "git log --oneline", "desc": "Shows a compact version of the commit history."},
|
|
63
|
-
{"cmd": "git remote add origin <url>", "desc": "Links your local repo to a remote GitHub repository."},
|
|
64
|
-
{"cmd": "git remote -v", "desc": "Verifies the link to the remote repository."},
|
|
65
|
-
{"cmd": "git branch -M main", "desc": "Renames the current branch to 'main'."},
|
|
66
|
-
{"cmd": "git push -u origin main", "desc": "Uploads local commits and sets the upstream branch."},
|
|
67
|
-
{"cmd": "git push", "desc": "Uploads local commits to the remote repository."}
|
|
68
|
-
],
|
|
69
|
-
"Prometheus & Utils": [
|
|
70
|
-
{"cmd": "mkdir ~/prom_lab", "desc": "Creates a directory for Prometheus and Grafana files."},
|
|
71
|
-
{"cmd": "cd ~/prom_lab", "desc": "Enters the Prometheus project directory."},
|
|
72
|
-
{"cmd": "nano prometheus.yml", "desc": "Creates or edits the Prometheus configuration file."},
|
|
73
|
-
{"cmd": "cat prometheus.yml", "desc": "Displays the Prometheus configuration content."},
|
|
74
|
-
{"cmd": "nano docker-compose.yml", "desc": "Creates or edits the Docker Compose configuration file."},
|
|
75
|
-
{"cmd": "cat docker-compose.yml", "desc": "Displays the Docker Compose file content."},
|
|
76
|
-
{"cmd": "sudo docker compose up -d", "desc": "Starts Prometheus and Grafana in detached mode."},
|
|
77
|
-
{"cmd": "sudo docker ps", "desc": "Checks if Prometheus and Grafana containers are running."},
|
|
78
|
-
{"cmd": "sudo docker compose down", "desc": "Stops and removes the multi-container application."}
|
|
79
|
-
],
|
|
80
|
-
"Kubernetes": [
|
|
81
|
-
{"cmd": "minikube start", "desc": "Starts the local Kubernetes cluster using Minikube."},
|
|
82
|
-
{"cmd": "minikube status", "desc": "Checks the status of the local Minikube cluster."},
|
|
83
|
-
{"cmd": "kubectl version --client", "desc": "Verifies that the kubectl client is working."},
|
|
84
|
-
{"cmd": "kubectl run my-pod --image=nginx", "desc": "Creates and runs a simple Nginx pod in the cluster."},
|
|
85
|
-
{"cmd": "kubectl get pods", "desc": "Lists all pods currently running in the cluster."},
|
|
86
|
-
{"cmd": "kubectl get pod my-pod -o wide", "desc": "Shows detailed pod info, including its IP and Node."},
|
|
87
|
-
{"cmd": "minikube service my-service --url", "desc": "Generates a URL to access a service in Minikube."},
|
|
88
|
-
{"cmd": "kubectl port-forward pod/my-pod 8080:80", "desc": "Forwards local port 8080 to the pod's port 80."},
|
|
89
|
-
{"cmd": "kubectl expose pod my-pod --type=NodePort", "desc": "Exposes a pod via a NodePort service."},
|
|
90
|
-
{"cmd": "kubectl get services", "desc": "Lists all services active in the cluster."},
|
|
91
|
-
{"cmd": "kubectl delete service my-service", "desc": "Removes a specific service from the cluster."},
|
|
92
|
-
{"cmd": "kubectl delete pod my-pod", "desc": "Deletes a specific pod from the cluster."},
|
|
93
|
-
{"cmd": "kubectl create deployment my-deploy", "desc": "Creates a deployment to manage replicated pods."},
|
|
94
|
-
{"cmd": "kubectl get deployment", "desc": "Lists all deployments and their status."},
|
|
95
|
-
{"cmd": "kubectl scale deployment --replicas=5", "desc": "Scales a deployment to the specified number of replicas."},
|
|
96
|
-
{"cmd": "minikube stop", "desc": "Stops the running local Kubernetes cluster."}
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
def clear_screen():
|
|
101
|
-
os.system('cls' if os.name == 'nt' else 'clear')
|
|
102
|
-
|
|
103
|
-
def print_banner():
|
|
104
|
-
banner = f"""
|
|
105
|
-
{Colors.GREY}{Colors.BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
106
|
-
DEVOPS WORKFLOW SEQUENCER
|
|
107
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━{Colors.RESET}
|
|
108
|
-
"""
|
|
109
|
-
print(banner)
|
|
110
|
-
|
|
111
|
-
def print_all_commands():
|
|
112
|
-
clear_screen()
|
|
113
|
-
print_banner()
|
|
114
|
-
print(f"{Colors.SOFT_CYAN}Initializing full workflow sequence...{Colors.RESET}\n")
|
|
115
|
-
time.sleep(0.5)
|
|
116
|
-
|
|
117
|
-
index = 1
|
|
118
|
-
for category, cmds in COMMANDS.items():
|
|
119
|
-
print(f"\n{Colors.BOLD}{Colors.SOFT_BLUE}[ {category.upper()} ]{Colors.RESET}")
|
|
120
|
-
print(f"{Colors.GREY}─────────────────────────────────────────{Colors.RESET}")
|
|
121
|
-
for item in cmds:
|
|
122
|
-
print(f"{Colors.SOFT_GREEN}[{index:02d}]{Colors.RESET} {Colors.BOLD}{item['cmd']}{Colors.RESET}")
|
|
123
|
-
print(f" {Colors.GREY}↳ {item['desc']}{Colors.RESET}")
|
|
124
|
-
index += 1
|
|
125
|
-
time.sleep(0.05) # Subtle "processing" delay
|
|
126
|
-
print()
|
|
127
|
-
|
|
128
|
-
print(f"\n{Colors.SOFT_GREEN}✓ Sequence complete.{Colors.RESET}")
|
|
129
|
-
input(f"\n{Colors.GREY}Return to control center...{Colors.RESET}")
|
|
130
|
-
|
|
131
|
-
def show_category(category):
|
|
132
|
-
clear_screen()
|
|
133
|
-
print_banner()
|
|
134
|
-
print(f"{Colors.SOFT_CYAN}Loading {category} process sequence...{Colors.RESET}\n")
|
|
135
|
-
time.sleep(0.3)
|
|
136
|
-
|
|
137
|
-
print(f"{Colors.BOLD}{Colors.SOFT_BLUE}[ {category.upper()} ]{Colors.RESET}")
|
|
138
|
-
print(f"{Colors.GREY}─────────────────────────────────────────{Colors.RESET}")
|
|
139
|
-
|
|
140
|
-
for i, item in enumerate(COMMANDS[category], 1):
|
|
141
|
-
print(f"{Colors.SOFT_GREEN}[{i:02d}]{Colors.RESET} {Colors.BOLD}{item['cmd']}{Colors.RESET}")
|
|
142
|
-
print(f" {Colors.GREY}↳ {item['desc']}{Colors.RESET}")
|
|
143
|
-
time.sleep(0.05)
|
|
144
|
-
|
|
145
|
-
print(f"\n{Colors.SOFT_GREEN}✓ Sequence ready.{Colors.RESET}")
|
|
146
|
-
input(f"\n{Colors.GREY}Return to control center...{Colors.RESET}")
|
|
147
|
-
|
|
148
|
-
def main():
|
|
149
|
-
while True:
|
|
150
|
-
clear_screen()
|
|
151
|
-
print_banner()
|
|
152
|
-
print(f"{Colors.DIM}Select operational module:{Colors.RESET}")
|
|
153
|
-
print(f"{Colors.SOFT_CYAN}01.{Colors.RESET} Docker Services")
|
|
154
|
-
print(f"{Colors.SOFT_CYAN}02.{Colors.RESET} Git Workflow")
|
|
155
|
-
print(f"{Colors.SOFT_CYAN}03.{Colors.RESET} Prometheus & Utilities")
|
|
156
|
-
print(f"{Colors.SOFT_CYAN}04.{Colors.RESET} Kubernetes Cluster")
|
|
157
|
-
print(f"{Colors.SOFT_CYAN}05.{Colors.RESET} {Colors.BOLD}Sequential Workflow Listing{Colors.RESET}")
|
|
158
|
-
print(f"{Colors.GREY}06.{Colors.RESET} Exit System")
|
|
159
|
-
|
|
160
|
-
choice = input(f"\n{Colors.SOFT_YELLOW}cmd_select >> {Colors.RESET}")
|
|
161
|
-
|
|
162
|
-
if choice in ['1', '01']:
|
|
163
|
-
show_category("Docker")
|
|
164
|
-
elif choice in ['2', '02']:
|
|
165
|
-
show_category("Git")
|
|
166
|
-
elif choice in ['3', '03']:
|
|
167
|
-
show_category("Prometheus & Utils")
|
|
168
|
-
elif choice == '4' or choice == '04':
|
|
169
|
-
show_category("Kubernetes")
|
|
170
|
-
elif choice == '5' or choice == '05':
|
|
171
|
-
print_all_commands()
|
|
172
|
-
elif choice == '6' or choice == '06':
|
|
173
|
-
print(f"\n{Colors.SOFT_GREEN}System shutdown initiated...{Colors.RESET}")
|
|
174
|
-
time.sleep(0.8)
|
|
175
|
-
break
|
|
176
|
-
else:
|
|
177
|
-
print(f"\n{Colors.SOFT_YELLOW}Command unrecognized.{Colors.RESET}")
|
|
178
|
-
time.sleep(1)
|
|
179
|
-
|
|
180
|
-
def run():
|
|
181
|
-
try:
|
|
182
|
-
main()
|
|
183
|
-
except KeyboardInterrupt:
|
|
184
|
-
print(f"\n\n{Colors.GREY}Process terminated by user.{Colors.RESET}")
|
|
185
|
-
sys.exit(0)
|
|
186
|
-
|
|
187
|
-
if __name__ == "__main__":
|
|
188
|
-
run()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|