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.
This commit is contained in:
+11
-11
@@ -1,14 +1,14 @@
|
|||||||
|
stages:
|
||||||
|
- pull
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
GIT_STRATEGY: none
|
GITLAB_CLONE_DIR: "cloudflaredns-java"
|
||||||
|
|
||||||
# Define job to clone GitHub repository
|
pull_source:
|
||||||
clone_source_daily:
|
stage: pull
|
||||||
# Use an appropriate GitLab runner image
|
|
||||||
image: alpine/git
|
|
||||||
script:
|
script:
|
||||||
- echo "Cloning source from GitHub..."
|
- echo "Cloning GitHub repository..."
|
||||||
- git clone https://th-schwarz:$GITHUB_PERSONAL_ACCESS_TOKEN@github.com/th-schwarz/CloudflareDNS-java.git synced-repo
|
- git clone --depth 1 https://oauth2:${GITHUB_PERSONAL_ACCESS_TOKEN}@github.com/th-schwarz/CloudflareDNS-java.git ${GITLAB_CLONE_DIR}
|
||||||
- echo "Repository cloned successfully from GitHub."
|
- echo "Repository cloned successfully."
|
||||||
rules:
|
only:
|
||||||
- if: $CI_PIPELINE_SOURCE == "schedule"
|
- schedules
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user