feat(ansible): add playbook for installing A13Labs systools with tasks for downloading, unpacking, and setting permissions
This commit is contained in:
@@ -1,11 +1,4 @@
|
||||
#!/bin/bash
|
||||
NAMESPACE=gitea
|
||||
PREFIX=gitea-app
|
||||
# Get the list of running pod names in the given namespace and filter by prefix
|
||||
POD_NAME=$(/usr/local/bin/kubectl get pods -n "$NAMESPACE" -o json | jq -r --arg PREFIX "$PREFIX" '.items[] | select(.metadata.name | startswith($PREFIX)) | select(.status.phase == "Running") | .metadata.name' | head -n 1)
|
||||
# Remove the -c flag from the command
|
||||
COMMAND=$(echo "$@" | sed "s/-c //g")
|
||||
# Check if a running pod matching the prefix is found
|
||||
if [ ! -z "$POD_NAME" ]; then
|
||||
/usr/local/bin/kubectl exec -n "$NAMESPACE" "$POD_NAME" -i -- env SSH_ORIGINAL_COMMAND="$SSH_ORIGINAL_COMMAND" su -s /bin/bash git -- $COMMAND
|
||||
fi
|
||||
/usr/local/bin/k8s_gitea_shell "$NAMESPACE" "$PREFIX" "$@"
|
||||
|
||||
Reference in New Issue
Block a user