diff options
| -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. |