Adds update-from-remote extendable job
What does this MR do?
This MR adds update-from-remote.yml
, which defines the .update_from_remote
extendable job. Extending the hidden job and defining the appropriate variables will cause a remote source to be fetched and compared with a path in the current project. If differences are detected, a new branch and MR in the current project will be created containing the detected changes.
Examples
The job below updates the project path bandit_clone
with the contents of
the relative path bandit/plugins
within the remote source
https://github.com/PyCQA/bandit
update_bandit_plugins:
extends: .update_from_remote
stage: sync
variables:
REMOTE_URI: "https://github.com/PyCQA/bandit"
REMOTE_PATH: "bandit/plugins"
DEST_PATH: "bandit_clone"
IGNORE: ""
The job below curls https://ipinfo.io/json
(since the git clone will fail)
and syncs it with the project file at ipinfo_response.json
:
update_ipinfo_response:
extends: .update_from_remote
stage: sync
variables:
REMOTE_URI: "http://ipinfo.io/json"
REMOTE_PATH: ""
DEST_PATH: "ipinfo_response.json"
IGNORE: ""
See https://gitlab.com/d0c-s4vage/updater-test for an example:
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
Edited by 🤖 GitLab Bot 🤖