From 39b72e5ba8be57b058987f11d945f1bf13b87945 Mon Sep 17 00:00:00 2001 From: Thilo Schwarz Date: Tue, 1 Apr 2025 18:11:40 +0200 Subject: [PATCH] Update CI pipeline to adjust clone job and add pull stage Reorganized the cloning logic into a dedicated pull stage and updated the cloning script for efficiency. Replaced `rules` with `only` to clarify job triggers and added the `GITLAB_CLONE_DIR` variable for better repository management. --- .gitlab-ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8e00e0b..6c76df9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,14 @@ +stages: + - pull + variables: - GIT_STRATEGY: none + GITLAB_CLONE_DIR: "cloudflaredns-java" -# Define job to clone GitHub repository -clone_source_daily: - # Use an appropriate GitLab runner image - image: alpine/git +pull_source: + stage: pull script: - - echo "Cloning source from GitHub..." - - git clone https://th-schwarz:$GITHUB_PERSONAL_ACCESS_TOKEN@github.com/th-schwarz/CloudflareDNS-java.git synced-repo - - echo "Repository cloned successfully from GitHub." - rules: - - if: $CI_PIPELINE_SOURCE == "schedule" - + - echo "Cloning GitHub repository..." + - git clone --depth 1 https://oauth2:${GITHUB_PERSONAL_ACCESS_TOKEN}@github.com/th-schwarz/CloudflareDNS-java.git ${GITLAB_CLONE_DIR} + - echo "Repository cloned successfully." + only: + - schedules