Fix clone log folder

This commit is contained in:
2025-07-09 14:23:44 +09:00
parent 106f79399a
commit ba2c207cce

View File

@@ -60,9 +60,11 @@ fi;
unique_id=$(uuidgen | tr -d '-' | head -c 8);
LOG_FILE="${GIT_WEBHOOK_BASE_FOLDER}${LOG_FOLDER}${REPOSITORY}.log";
# from the repository get the last path without the .git so we have the target folder
# strip .git from the repository path
GIT_REPOSITORY_NAME=$(basename "${REPOSITORY}" .git);
# log folder target
LOG_FILE="${GIT_WEBHOOK_BASE_FOLDER}${LOG_FOLDER}${GIT_REPOSITORY_NAME}.log";
# from the repository get the last path without the .git so we have the target folder
echo "[$(date +"%Y-%m-%d %H:%M:%S")] [${unique_id}] [START] New clone from ${REMOTE_HOST}:${REPOSITORY}::${BRANCH} into ${GIT_REPOSITORY_NAME}" | tee -a "$LOG_FILE";
# clone everything
GIT_COMMAND=("${GIT_COMMAND_BASE[@]}" "clone" "-b" "${BRANCH}" "--single-branch" "--depth" "1" "--origin" "${REMOTE_NAME}" "${REMOTE_HOST}:${REPOSITORY}" "${GIT_WEBHOOK_BASE_FOLDER}${CLONE_BASE}${GIT_REPOSITORY_NAME}")