mirror of
https://github.com/A6-9V/MQL5-Google-Onedrive.git
synced 2026-04-10 20:40:56 +00:00
- Added .github/workflows/gitlab-sync.yml for automated synchronization. - Fixed scripts/setup_gitlab_runner.sh with the provided runner authentication token. - Finalized .gitlab-ci.yml and docs/GITLAB_INTEGRATION.md.
36 lines
1.2 KiB
Bash
Executable file
36 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
log_info() { echo -e "\033[0;36m[INFO]\033[0m $1"; }
|
|
log_success() { echo -e "\033[0;32m[SUCCESS]\033[0m $1"; }
|
|
GITLAB_URL="https://gitlab.com/"
|
|
# Provided by user in Screenshot_20260224-135026.jpg
|
|
DEFAULT_RUNNER_TOKEN="glrt-1ZsoNDOLM3I_AA8MD7Qhn286MQpwOjFiYnU4NQp1OmtxZHRpCw.01.1j17j8yjf"
|
|
|
|
install_runner() {
|
|
if ! command -v gitlab-runner &> /dev/null; then
|
|
log_info "Installing GitLab Runner binary..."
|
|
sudo curl -L --output /usr/local/bin/gitlab-runner "https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64"
|
|
sudo chmod +x /usr/local/bin/gitlab-runner
|
|
fi
|
|
}
|
|
|
|
register_runner() {
|
|
local token=${1:-$DEFAULT_RUNNER_TOKEN}
|
|
log_info "Registering runner with token: ${token:0:10}..."
|
|
sudo gitlab-runner register \
|
|
--non-interactive \
|
|
--url "$GITLAB_URL" \
|
|
--token "$token" \
|
|
--executor "docker" \
|
|
--docker-image "python:3.10-slim" \
|
|
--description "mql5-gitlab-runner" \
|
|
--tag-list "mql5,docker,linux" \
|
|
--run-untagged="true"
|
|
}
|
|
|
|
main() {
|
|
install_runner
|
|
register_runner "${1:-}"
|
|
log_success "Runner setup complete!"
|
|
}
|
|
main "$@"
|