From 9baca159671efb145e63b4c7e5f0f6e8bb7ba5b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Thu, 26 Nov 2026 20:55:00 +0100 Subject: Documentation for push job Changelog: Added job section to push commits to another repository. --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index dc85086..f4e0edb 100644 --- a/README.md +++ b/README.md @@ -240,3 +240,43 @@ Elements of the `publish` list are dictionaries with following elements: `path` : Path within the destination to publish this artifact to. If not given, artifact path from the work directory is used. + + +Push commit to repo +------------------- + +Another action that can be performed by a job is pushing a given commit to another repository. +The target repository must be declared at the top of the job file with the `writable` flag: + +``` +repo : + path: + writable: true +``` + +The repository path can be given also on command line in the form `--writable-repo=:`. +The commits to push are then given in the `push` list within the job definition: + +``` +repo source_repo: + +repo target_repo: + writable: true + +job push_job: + push: + - commit: source_repo.commit + to: target_repo.branch("master") +``` + +Elements of the `push` list are dictionaries with following elements: + +`commit` +: Commit to push, currently in the form `.commit`, denoting commit within `` used in the job. + +`to` +: Destination branch, currently in the form `.branch("")`. + +If the target branch can be moved fast-forward to the source commit, the branch is moved and the job succeeds. +If the source commit is an ancestor of the tip of the target branch, the branch is not moved and the job also succeeds. +Otherwise, the target branch is not moved and the job fails. -- cgit v1.2.3