From c2926416902ffe5b2c72acfa97e0ecaf6fe013e5 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Fri, 10 Aug 2018 13:57:55 -0400 Subject: [PATCH] More repo docs --- docs/API.dox | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/docs/API.dox b/docs/API.dox index 6783c24120..f06d754d2e 100644 --- a/docs/API.dox +++ b/docs/API.dox @@ -261,7 +261,7 @@ To clone the repository if it doesn't yet exist use the following request: I PUT "/Repository" => @ref Tgstation.Server.Api.Models.Repository -The clone job will be represented by the @ref Tgstation.Server.Api.Models.Repository.ActiveJob field. Specify the @ref Tgstation.Server.Api.Models.Origin URL. Optionally specify the initial @ref Tgstation.Server.Api.Models.Repository.Reference as a git tag or branch. Be sure to specify the authentication fields if necessary to access your repository +The clone job will be represented by the @ref Tgstation.Server.Api.Models.Repository.ActiveJob field. Specify the @ref Tgstation.Server.Api.Models.Repository.Origin URL. Optionally specify the initial @ref Tgstation.Server.Api.Models.Repository.Reference as a git tag or branch. Be sure to specify the authentication fields if necessary to access your repository To delete an existing repository make the following request: @@ -271,5 +271,63 @@ Modifications to the repository are done with the following request: I POST "/Repository" => @ref Tgstation.Server.Api.Models.Repository => @ref Tgstation.Server.Api.Models.Repository -Each update creates a job specified in the @ref Tgstation.Server.Api.Models.Repository.ActiveJob field jobs will be queued in succession. +Each update creates a job specified in the @ref Tgstation.Server.Api.Models.Repository.ActiveJob field jobs will be queued in succession. See below for post examples. + +@subsubsection api_repopost Repository Commands for Git Aliases + +All these actions are done with the POST method + +git pull (Only if @ref Tgstation.Server.Api.Models.Repository.Reference is set): +@code{.json} +{ + "updateFromOrigin": true +} +@endcode + +git checkout (Unsets @ref Tgstation.Server.Api.Models.Repository.Reference): +@code{.json} +{ + "checkoutSha": "" +} +@endcode + +git checkout -f && git clean -fxd (Sets @ref Tgstation.Server.Api.Models.Repository.Reference): +@code{.json} +{ + "reference": "" +} +@endcode + +git fetch && git checkout -f branch && git clean -fxd && git reset --hard origin/branch (Sets @ref Tgstation.Server.Api.Models.Repository.Reference); +@code{.json} +{ + "updateFromOrigin": true, + "reference": "branch" +} +@endcode + +@subsubsection api_repotm Test Merging + +Any of the above POST methods can be combined with the @ref Tgstation.Server.Api.Models.Repository.NewTestMerges field to add test merges on top of the checked out commit. + +@code{.json} +{ + "newTestMerges": [ + { + "number": 12345, + "comment": "I'm merging this for x reason" + }, + { + "number": 12346, + "pullRequestRevision": "abcdef1" + } + ] +} +@endcode + +If the server detects a set of @ref Tgstation.Server.Api.Models.TestMergeParameters being applied that it has seen before, it'll instead attempt to checkout the commit that was created then. + + + + */