Files
italiadatacenter/st2idc/run-clone-and-transform.sh
T
2026-08-26 10:45:35 +02:00

51 lines
1.3 KiB
Bash

#!/bin/bash
set -euo pipefail
# Launcher script for clone-and-transform.sh
# Fill all values below before running.
GITLAB_URL="https://gitlab.com"
GITLAB_TOKEN="glpat-E67BjdXoKvSEgHG31XZW0GM6MQpvOjEKdTozNzF5OQ8.01.171191k74"
GITLAB_REPO_PATH=$1
DEST_DIR="./work-repo"
TRANSFORM_FILE=$3
GITEA_REPO_PATH=$2
TRANSFORMATION_ONLY="${4:-false}"
#
#GITLAB_URL="https://gitlab.com"
#GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx"
#GITLAB_REPO_PATH="group/project"
#DEST_DIR="./work-repo"
#TRANSFORM_FILE="./transform.env"
#GITEA_REPO_PATH="group/project"
# Set to "true" to skip GitLab clone and run only: Gitea clone + transform + commit/push
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MAIN_SCRIPT="${SCRIPT_DIR}/clone-and-transform.sh"
if [[ ! -f "$MAIN_SCRIPT" ]]; then
echo "[ERROR] Main script not found: $MAIN_SCRIPT"
exit 1
fi
chmod +x "$MAIN_SCRIPT"
if [[ "$TRANSFORMATION_ONLY" == "true" ]]; then
"$MAIN_SCRIPT" \
-transformation \
--dest "$DEST_DIR" \
--transform "$TRANSFORM_FILE" \
--gitea-repo "$GITEA_REPO_PATH"
else
"$MAIN_SCRIPT" \
--url "$GITLAB_URL" \
--token "$GITLAB_TOKEN" \
--repo "$GITLAB_REPO_PATH" \
--dest "$DEST_DIR" \
--transform "$TRANSFORM_FILE" \
--gitea-repo "$GITEA_REPO_PATH"
fi