diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-11-26 20:55:00 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-11-28 10:42:32 +0100 |
| commit | 9baca159671efb145e63b4c7e5f0f6e8bb7ba5b2 (patch) | |
| tree | f84bec85534fae448de00b6a2f20d4c7cae0bd58 | |
| parent | 06afc252debb820b7a7b3e0fee48c8743bb80583 (diff) | |
Documentation for push job
Changelog: Added job section to push commits to another repository.
| -rw-r--r-- | README.md | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -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 <name>: + path: <path/to/repository> + writable: true +``` + +The repository path can be given also on command line in the form `--writable-repo=<name>:<path>`. +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 `<repo>.commit`, denoting commit within `<repo>` used in the job. + +`to` +: Destination branch, currently in the form `<repo>.branch("<branch name>")`. + +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. |