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