diff --git a/.github/versions.env b/.github/versions.env index 8447c76..677acf6 100755 --- a/.github/versions.env +++ b/.github/versions.env @@ -1,3 +1,3 @@ -IMAGE_VERSION=1.21.9 +IMAGE_VERSION=1.21.10 NDK_VERSION=27.2.12479018 BAZELISK_VERSION=v1.26.0 diff --git a/android_dev/Dockerfile b/android_dev/Dockerfile index a8a84fc..3372d1c 100644 --- a/android_dev/Dockerfile +++ b/android_dev/Dockerfile @@ -67,12 +67,12 @@ RUN RUNZSH=no sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmy RUN echo "export NVM_DIR=${NVM_DIR}" >> /home/${ACTUAL_USER}/.zshrc && \ echo "export PNPM_HOME=${PNPM_HOME}" >> /home/${ACTUAL_USER}/.zshrc && \ echo "export PATH=${PATH}" >> /home/${ACTUAL_USER}/.zshrc && \ - echo "source ${NVM_DIR}/nvm.sh" >> /home/${ACTUAL_USER}/.zshrc && \ - echo "tmux attach-session -t dev-session 2>/dev/null || tmux new-session -s dev-session" >> /home/${ACTUAL_USER}/.zshrc + echo "source ${NVM_DIR}/nvm.sh" >> /home/${ACTUAL_USER}/.zshrc # Switch back to root for remaining setup USER root +COPY tmux.conf /etc/tmux.conf COPY entrypoint.sh /opt/workspace/entrypoint.sh RUN chmod +x /opt/workspace/entrypoint.sh diff --git a/android_dev/entrypoint.sh b/android_dev/entrypoint.sh index c8d8ea9..34f85a5 100755 --- a/android_dev/entrypoint.sh +++ b/android_dev/entrypoint.sh @@ -17,13 +17,18 @@ WORKSPACE_DIR="/opt/workspace" REPO_NAME=$(basename "${GIT_REPO}") CLONE_DIR="${WORKSPACE_DIR}/${REPO_NAME}" +# Define the tmux session name +TMUX_SESSION_NAME="${GIT_BRANCH}-${REPO_NAME}" +export TMUX_SESSION_NAME + # --- 1. Clone Git Repository --- echo "Cloning repository '${GIT_REPO}' from branch '${GIT_BRANCH}'..." # Clone the repository into a specific subdirectory within the workspace -git clone --branch "${GIT_BRANCH}" "https://${GIT_PROVIDER}/${GIT_REPO}" "${CLONE_DIR}" +git clone --branch "${GIT_BRANCH}" "git@${GIT_PROVIDER}:${GIT_REPO}.git" "${CLONE_DIR}" # The user should be in the clone folder right after login echo "cd $CLONE_DIR" >> "/home/${ACTUAL_USER}/.zshrc" +echo "tmux attach-session -t \"${TMUX_SESSION_NAME}\" 2>/dev/null || tmux new-session -s \"${TMUX_SESSION_NAME}\"" >> "/home/${ACTUAL_USER}/.zshrc" # --- 2. Set Permissions --- diff --git a/android_dev/tmux.conf b/android_dev/tmux.conf new file mode 100644 index 0000000..5077c3f --- /dev/null +++ b/android_dev/tmux.conf @@ -0,0 +1,35 @@ +# Set the prefix to Ctrl+b +set-option -g prefix C-b +bind-key C-b send-prefix + +# Enable mouse mode (tmux 2.1 and above) +set -g mouse on + +# Set a longer history limit +set -g history-limit 10000 + +# Start windows and panes at 1, not 0 +set -g base-index 1 +setw -g pane-base-index 1 + +# Renumber windows when a window is closed +set-option -g renumber-windows on + +# Use Alt-arrow keys to switch panes +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +# Shift-arrow to switch windows +bind -n S-Left previous-window +bind -n S-Right next-window + +# Easy-to-remember split pane commands +bind | split-window -h +bind - split-window -v +unbind '"' +unbind % + +# Reload config file +bind r source-file /etc/tmux.conf \; display "Reloaded!" \ No newline at end of file