update scripts

This commit is contained in:
xfy
2025-01-13 08:29:53 +08:00
parent 3599ac9416
commit 348042a1ca
4 changed files with 91 additions and 1 deletions

83
rua-scripts/rua-tag.sh Normal file
View File

@ -0,0 +1,83 @@
#!/bin/bash
# Function to tag and push a Docker image
# Example usage
# tag_and_push gitlab/gitlab-runner
tag_and_push() {
if [ -z "$1" ]; then
echo "Usage: tag_and_push <image-name>"
return 1
fi
# Set variables
local IMAGE_NAME=$1
local TARGET_IMAGE="192.168.1.57:8004/$IMAGE_NAME"
# Tag the Docker image
echo "Tagging image: $IMAGE_NAME as $TARGET_IMAGE"
docker tag "$IMAGE_NAME" "$TARGET_IMAGE"
# Push the Docker image
echo "Pushing image: $TARGET_IMAGE"
docker push "$TARGET_IMAGE"
if [ $? -eq 0 ]; then
echo "Image successfully tagged and pushed: $TARGET_IMAGE"
else
echo "Failed to push the image: $TARGET_IMAGE"
return 2
fi
}
check_client() {
if [ -d "$FOLDER_PATH" ]; then
return 0
else
return 1
fi
}
build_lib() {
if [ -z "$1" ]; then
echo "Usage: build_lib <version [v2/v3]> <method [nocopy/debug]>"
return 1
fi
VERSION=$1
METHOD=$2
case $VERSION in
v2)
echo "Building lib v2"
FOLDER_PATH="../show-client-v2/src/show/lib/"
check_client
if [ $? -ne 0 ]; then
echo "Show-client v2 not found"
return -1
fi
setopt rm_star_silent
npx gulp $METHOD
rm -rf "$FOLDER_PATH/*"
cp -aR lib/* $FOLDER_PATH
echo 'Copy done'
;;
v3)
echo "Building lib v3"
FOLDER_PATH="../show-client/src/show/lib/"
check_client
if [ $? -ne 0 ]; then
echo "Show-client v3 not found"
return -1
fi
setopt rm_star_silent
npx gulp $METHOD
rm -rf "$FOLDER_PATH/*"
cp -aR lib/* $FOLDER_PATH
echo 'Copy done'
;;
*)
echo "Invalid version: $1"
return 2
;;
esac
}

View File

@ -0,0 +1,4 @@
#!/bin/env bash
# 16 mysql
ssh -f -N -L 192.168.1.57:3306:localhost:3306 16

View File

@ -29,7 +29,8 @@ setw -g pane-base-index 1
# Enable mouse support # Enable mouse support
set -g mouse on set -g mouse on
# forward slash
# bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# ========================== # ==========================
# === Key bindings === # === Key bindings ===

View File

@ -109,6 +109,8 @@ if [ -r $RUA_SCRIPT_DIR/xdg-startup.sh ]; then
source ~/.config/rua-scripts/xdg-startup.sh source ~/.config/rua-scripts/xdg-startup.sh
source ~/.config/rua-scripts/docker.sh source ~/.config/rua-scripts/docker.sh
source ~/.config/rua-scripts/show-client.sh source ~/.config/rua-scripts/show-client.sh
source ~/.config/rua-scripts/rua-tag.sh
source ~/.config/rua-scripts/ssh-forward.sh
fi fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.