-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR to main branch before building
- Loading branch information
Showing
10 changed files
with
159 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module Git = Current_git | ||
|
||
type t = Git.Commit_id.t * Git.Commit_id.t list | ||
|
||
let make ~base merge_commits = (base, merge_commits) | ||
let no_merge base = (base, []) | ||
|
||
let spec (base, merges) = | ||
let open Obuilder_spec in | ||
Spec.minimal "alpine" | ||
|> Spec.add | ||
([ | ||
shell [ "/bin/sh"; "-c" ]; | ||
run ~network:[ "host" ] "apk add git"; | ||
workdir "/merged"; | ||
run ~network:[ "host" ] | ||
"git config --global user.email \"[email protected]\" && git config \ | ||
--global user.name \"None\""; | ||
run ~network:[ "host" ] | ||
"git clone --recursive %S /merged && git fetch origin %S && git \ | ||
reset --hard %s" | ||
(Git.Commit_id.repo base) (Git.Commit_id.gref base) | ||
(Git.Commit_id.hash base); | ||
] | ||
@ List.map | ||
(fun merge -> | ||
run ~network:[ "host" ] "git fetch origin %S && git merge %s" | ||
(Git.Commit_id.gref merge) (Git.Commit_id.hash merge)) | ||
merges) | ||
|> Spec.finish | ||
|
||
let to_list (base, merge) = base :: merge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
type t | ||
|
||
val make : base:Current_git.Commit_id.t -> Current_git.Commit_id.t list -> t | ||
(* Assumption: the commits are all on the same repository. *) | ||
|
||
val no_merge : Current_git.Commit_id.t -> t | ||
val spec : t -> Obuilder_spec.t | ||
val to_list : t -> Current_git.Commit_id.t list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.