22 lines
No EOL
821 B
YAML
22 lines
No EOL
821 B
YAML
stages:
|
|
- update_patched_master
|
|
|
|
update_patched_master:
|
|
stage: update_patched_master
|
|
only:
|
|
- patched_changes
|
|
script:
|
|
- apk --no-cache add git
|
|
- echo "Setting up Git repository locally..."
|
|
- git clone http://oauth2:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git /tmp/repo
|
|
- cd /tmp/repo
|
|
- echo "Fetching all branches..."
|
|
- git fetch origin
|
|
- echo "Verifying if patched_changes exists..."
|
|
- if git show-ref --verify --quiet refs/remotes/origin/patched_changes; then
|
|
echo "patched_changes branch found. Proceeding...";
|
|
git checkout patched_master || git checkout -b patched_master;
|
|
git reset --hard origin/patched_changes;
|
|
fi
|
|
- echo "Force-pushing patched_master to match patched_changes..."
|
|
- git push origin patched_master --force |