mirror of
https://github.com/shadoll/just-commons.git
synced 2025-12-20 04:27:43 +00:00
Refactor: Remove unnecessary [group] annotations from management scripts
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "just-commons"]
|
||||||
|
path = just-commons
|
||||||
|
url = https://github.com/shadoll/just-commons.git
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
# Universal container management operations
|
# Universal container management operations
|
||||||
|
|
||||||
# Start service (or all services if no service specified)
|
# Start service (or all services if no service specified)
|
||||||
[group('container')]
|
|
||||||
start service="" compose-file="":
|
start service="" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -27,7 +26,6 @@ start service="" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Stop service (or all services if no service specified)
|
# Stop service (or all services if no service specified)
|
||||||
[group('container')]
|
|
||||||
stop service="" compose-file="":
|
stop service="" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -53,7 +51,6 @@ stop service="" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Restart service (or all services if no service specified)
|
# Restart service (or all services if no service specified)
|
||||||
[group('container')]
|
|
||||||
restart service="" compose-file="":
|
restart service="" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -78,7 +75,6 @@ restart service="" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Show service status (specific service or all)
|
# Show service status (specific service or all)
|
||||||
[group('container')]
|
|
||||||
status service="" compose-file="":
|
status service="" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -102,7 +98,6 @@ status service="" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# View logs for specific service or all services
|
# View logs for specific service or all services
|
||||||
[group('container')]
|
|
||||||
logs service="" compose-file="":
|
logs service="" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -126,7 +121,6 @@ logs service="" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Open shell in specific container
|
# Open shell in specific container
|
||||||
[group('container')]
|
|
||||||
shell service compose-file="":
|
shell service compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -145,7 +139,6 @@ shell service compose-file="":
|
|||||||
$compose_cmd $file_arg exec "$service" /bin/bash
|
$compose_cmd $file_arg exec "$service" /bin/bash
|
||||||
|
|
||||||
# Execute command in specific service container
|
# Execute command in specific service container
|
||||||
[group('container')]
|
|
||||||
exec service cmd compose-file="":
|
exec service cmd compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# Universal container image operations
|
# Universal container image operations
|
||||||
|
|
||||||
# Build project image
|
# Build project image
|
||||||
[group('images')]
|
|
||||||
build project tag="":
|
build project tag="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -59,7 +58,6 @@ build project tag="":
|
|||||||
echo -e "{{GREEN}}✓ Successfully built: $image_name{{NORMAL}}"
|
echo -e "{{GREEN}}✓ Successfully built: $image_name{{NORMAL}}"
|
||||||
|
|
||||||
# Push project image to registry
|
# Push project image to registry
|
||||||
[group('images')]
|
|
||||||
push project tag="":
|
push project tag="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -100,7 +98,6 @@ push project tag="":
|
|||||||
echo -e "{{GREEN}}✓ Successfully pushed: $image_name{{NORMAL}}"
|
echo -e "{{GREEN}}✓ Successfully pushed: $image_name{{NORMAL}}"
|
||||||
|
|
||||||
# Pull project image from registry
|
# Pull project image from registry
|
||||||
[group('images')]
|
|
||||||
pull project tag="latest":
|
pull project tag="latest":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -132,7 +129,6 @@ pull project tag="latest":
|
|||||||
echo -e "{{GREEN}}✓ Successfully pulled: $image_name{{NORMAL}}"
|
echo -e "{{GREEN}}✓ Successfully pulled: $image_name{{NORMAL}}"
|
||||||
|
|
||||||
# Tag existing image
|
# Tag existing image
|
||||||
[group('images')]
|
|
||||||
tag project new_tag:
|
tag project new_tag:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -172,7 +168,6 @@ tag project new_tag:
|
|||||||
echo -e "{{GREEN}}✓ Successfully tagged: $new_image{{NORMAL}}"
|
echo -e "{{GREEN}}✓ Successfully tagged: $new_image{{NORMAL}}"
|
||||||
|
|
||||||
# Show image information
|
# Show image information
|
||||||
[group('images')]
|
|
||||||
info project tag="":
|
info project tag="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -213,7 +208,6 @@ info project tag="":
|
|||||||
$runtime history "$image_name" 2>/dev/null || echo "Image not found locally"
|
$runtime history "$image_name" 2>/dev/null || echo "Image not found locally"
|
||||||
|
|
||||||
# Remove project images
|
# Remove project images
|
||||||
[group('images')]
|
|
||||||
[confirm]
|
[confirm]
|
||||||
clean project:
|
clean project:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@@ -261,7 +255,6 @@ clean project:
|
|||||||
echo -e "{{GREEN}}✓ Project images cleaned{{NORMAL}}"
|
echo -e "{{GREEN}}✓ Project images cleaned{{NORMAL}}"
|
||||||
|
|
||||||
# Build all known projects
|
# Build all known projects
|
||||||
[group('images')]
|
|
||||||
build-all:
|
build-all:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# Universal MySQL database operations
|
# Universal MySQL database operations
|
||||||
|
|
||||||
# Execute MySQL SQL query
|
# Execute MySQL SQL query
|
||||||
[group('database')]
|
|
||||||
sql query service="mysql" compose-file="":
|
sql query service="mysql" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -32,7 +31,6 @@ sql query service="mysql" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check MySQL connection and status
|
# Check MySQL connection and status
|
||||||
[group('database')]
|
|
||||||
check service="mysql" compose-file="":
|
check service="mysql" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -57,7 +55,6 @@ check service="mysql" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# List MySQL databases
|
# List MySQL databases
|
||||||
[group('database')]
|
|
||||||
list-databases service="mysql" compose-file="":
|
list-databases service="mysql" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -80,7 +77,6 @@ list-databases service="mysql" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# List MySQL users
|
# List MySQL users
|
||||||
[group('database')]
|
|
||||||
list-users service="mysql" compose-file="":
|
list-users service="mysql" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -103,7 +99,6 @@ list-users service="mysql" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create MySQL database
|
# Create MySQL database
|
||||||
[group('database')]
|
|
||||||
create-database database service="mysql" compose-file="":
|
create-database database service="mysql" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -133,7 +128,6 @@ create-database database service="mysql" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Drop MySQL database
|
# Drop MySQL database
|
||||||
[group('database')]
|
|
||||||
[confirm]
|
[confirm]
|
||||||
drop-database database service="mysql" compose-file="":
|
drop-database database service="mysql" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@@ -165,7 +159,6 @@ drop-database database service="mysql" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create MySQL user
|
# Create MySQL user
|
||||||
[group('database')]
|
|
||||||
create-user username password service="mysql" compose-file="":
|
create-user username password service="mysql" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -196,7 +189,6 @@ create-user username password service="mysql" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Grant MySQL privileges
|
# Grant MySQL privileges
|
||||||
[group('database')]
|
|
||||||
grant-privileges database username service="mysql" compose-file="":
|
grant-privileges database username service="mysql" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -227,7 +219,6 @@ grant-privileges database username service="mysql" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# MySQL interactive shell
|
# MySQL interactive shell
|
||||||
[group('database')]
|
|
||||||
shell service="mysql" compose-file="":
|
shell service="mysql" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -250,7 +241,6 @@ shell service="mysql" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore MySQL database from backup file
|
# Restore MySQL database from backup file
|
||||||
[group('database')]
|
|
||||||
[confirm]
|
[confirm]
|
||||||
restore backup_file database service="mysql" compose-file="" backup_path="./backups":
|
restore backup_file database service="mysql" compose-file="" backup_path="./backups":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# Universal PostgreSQL database operations
|
# Universal PostgreSQL database operations
|
||||||
|
|
||||||
# Execute PostgreSQL SQL query
|
# Execute PostgreSQL SQL query
|
||||||
[group('database')]
|
|
||||||
sql query service="postgres" compose-file="":
|
sql query service="postgres" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -32,7 +31,6 @@ sql query service="postgres" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check PostgreSQL connection and status
|
# Check PostgreSQL connection and status
|
||||||
[group('database')]
|
|
||||||
check service="postgres" compose-file="":
|
check service="postgres" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -57,7 +55,6 @@ check service="postgres" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# List PostgreSQL databases
|
# List PostgreSQL databases
|
||||||
[group('database')]
|
|
||||||
list-databases service="postgres" compose-file="":
|
list-databases service="postgres" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -80,7 +77,6 @@ list-databases service="postgres" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# List PostgreSQL users
|
# List PostgreSQL users
|
||||||
[group('database')]
|
|
||||||
list-users service="postgres" compose-file="":
|
list-users service="postgres" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -103,7 +99,6 @@ list-users service="postgres" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create PostgreSQL database
|
# Create PostgreSQL database
|
||||||
[group('database')]
|
|
||||||
create-database database service="postgres" compose-file="":
|
create-database database service="postgres" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -133,7 +128,6 @@ create-database database service="postgres" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Drop PostgreSQL database
|
# Drop PostgreSQL database
|
||||||
[group('database')]
|
|
||||||
[confirm]
|
[confirm]
|
||||||
drop-database database service="postgres" compose-file="":
|
drop-database database service="postgres" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@@ -165,7 +159,6 @@ drop-database database service="postgres" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# PostgreSQL interactive shell
|
# PostgreSQL interactive shell
|
||||||
[group('database')]
|
|
||||||
shell service="postgres" compose-file="":
|
shell service="postgres" compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -188,7 +181,6 @@ shell service="postgres" compose-file="":
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore PostgreSQL database from backup file
|
# Restore PostgreSQL database from backup file
|
||||||
[group('database')]
|
|
||||||
[confirm]
|
[confirm]
|
||||||
restore backup_file service="postgres" compose-file="" backup_path="./backups":
|
restore backup_file service="postgres" compose-file="" backup_path="./backups":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# Container registry authentication and management
|
# Container registry authentication and management
|
||||||
|
|
||||||
# Login to container registry
|
# Login to container registry
|
||||||
[group('registry')]
|
|
||||||
login:
|
login:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -21,7 +20,6 @@ login:
|
|||||||
echo -e "{{GREEN}}✓ Successfully logged into $registry{{NORMAL}}"
|
echo -e "{{GREEN}}✓ Successfully logged into $registry{{NORMAL}}"
|
||||||
|
|
||||||
# Logout from container registry
|
# Logout from container registry
|
||||||
[group('registry')]
|
|
||||||
logout:
|
logout:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -35,7 +33,6 @@ logout:
|
|||||||
echo -e "{{GREEN}}✓ Successfully logged out from $registry{{NORMAL}}"
|
echo -e "{{GREEN}}✓ Successfully logged out from $registry{{NORMAL}}"
|
||||||
|
|
||||||
# Check registry authentication status
|
# Check registry authentication status
|
||||||
[group('registry')]
|
|
||||||
check:
|
check:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# Universal volume management operations
|
# Universal volume management operations
|
||||||
|
|
||||||
# Clean all volumes used by compose file (DESTRUCTIVE!)
|
# Clean all volumes used by compose file (DESTRUCTIVE!)
|
||||||
[group('volumes')]
|
|
||||||
[confirm]
|
[confirm]
|
||||||
clean-all compose-file="":
|
clean-all compose-file="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@@ -33,7 +32,6 @@ clean-all compose-file="":
|
|||||||
echo -e "{{GREEN}}✓ All volumes removed{{NORMAL}}"
|
echo -e "{{GREEN}}✓ All volumes removed{{NORMAL}}"
|
||||||
|
|
||||||
# Remove specific volume by name (DESTRUCTIVE!)
|
# Remove specific volume by name (DESTRUCTIVE!)
|
||||||
[group('volumes')]
|
|
||||||
[confirm]
|
[confirm]
|
||||||
remove volume_name:
|
remove volume_name:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@@ -64,7 +62,6 @@ remove volume_name:
|
|||||||
echo -e "{{GREEN}}✓ Volume '$volume_name' removed{{NORMAL}}"
|
echo -e "{{GREEN}}✓ Volume '$volume_name' removed{{NORMAL}}"
|
||||||
|
|
||||||
# Remove volumes matching pattern (DESTRUCTIVE!)
|
# Remove volumes matching pattern (DESTRUCTIVE!)
|
||||||
[group('volumes')]
|
|
||||||
[confirm]
|
[confirm]
|
||||||
remove-pattern pattern:
|
remove-pattern pattern:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
@@ -104,7 +101,6 @@ remove-pattern pattern:
|
|||||||
echo -e "{{GREEN}}✓ Matching volumes removed{{NORMAL}}"
|
echo -e "{{GREEN}}✓ Matching volumes removed{{NORMAL}}"
|
||||||
|
|
||||||
# List all volumes or filter by pattern
|
# List all volumes or filter by pattern
|
||||||
[group('volumes')]
|
|
||||||
list pattern="":
|
list pattern="":
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|||||||
Reference in New Issue
Block a user