Update .gitlab-ci.yml file
This commit is contained in:
parent
d246559430
commit
06574fa87e
1 changed files with 11 additions and 1 deletions
|
@ -10,15 +10,25 @@ update_patched_master:
|
|||
only:
|
||||
- patched_changes
|
||||
script:
|
||||
- apk add --no-cache git
|
||||
- echo "Setting up Git..."
|
||||
- git config user.name "$GITLAB_USER_NAME"
|
||||
- git config user.email "$GITLAB_USER_EMAIL"
|
||||
- git remote set-url origin http://oauth2:${GITLAB_ACCESS_TOKEN}@gitlab/${CI_PROJECT_PATH}.git
|
||||
- git remote set-url origin https://oauth2:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
|
||||
- echo "Fetching all branches..."
|
||||
- git fetch --all
|
||||
- echo "Checking out patched_master..."
|
||||
- git checkout patched_master
|
||||
- echo "Merging master into patched_master..."
|
||||
- git merge origin/master --no-edit
|
||||
- echo "Cleaning working directory..."
|
||||
- git rm -r --cached .
|
||||
- git clean -fd
|
||||
- echo "Overwriting all files from patched_changes (excluding .gitlab-ci.yml)..."
|
||||
- git checkout origin/patched_changes -- . ':!.gitlab-ci.yml'
|
||||
- echo "Adding changes..."
|
||||
- git add .
|
||||
- echo "Committing changes..."
|
||||
- git commit -m "Auto-update patched_master with changes from patched_changes"
|
||||
- echo "Pushing changes to patched_master..."
|
||||
- git push origin patched_master
|
||||
|
|
Loading…
Reference in a new issue