@@ -77,32 +77,40 @@ let private publishZip _ =
7777let private publishContainers _ =
7878
7979 let createImage project =
80+ let ci = Environment.environVarOrNone " GITHUB_ACTIONS"
81+ let pr =
82+ match Environment.environVarOrNone " GITHUB_REF_NAME" with
83+ | None -> None
84+ | Some s when s.EndsWith " /merge" -> Some ( s.Split( '/' ) |> Seq.head)
85+ | _ -> None
8086 let imageTag =
8187 match project with
82- | " docs-builder" -> " jammy-chiseled-aot"
83- | _ -> " jammy-chiseled-aot"
88+ | _ -> " 9.0-noble-chiseled-aot"
8489 let labels =
8590 let exitCode = exec {
8691 validExitCode ( fun _ -> true )
8792 exit_ code_ of " git" " describe" " --tags" " --exact-match" " HEAD"
8893 }
89- match exitCode with | 0 -> " edge;latest" | _ -> " edge"
94+ match ( exitCode, pr) with
95+ | 0 , _ -> " edge;latest"
96+ | _, None -> " edge"
97+ | _, Some pr -> $" ci-%s {pr}"
9098 let args =
9199 [ " publish" ; $" src/tooling/%s {project}/%s {project}.csproj" ]
92100 @ [
93101 " /t:PublishContainer" ;
94102 " -p" ; " DebugType=none" ;
95- " -p" ; $" ContainerBaseImage=mcr.microsoft.com/dotnet/nightly/runtime-deps:8.0- %s {imageTag}" ;
103+ " -p" ; $" ContainerBaseImage=mcr.microsoft.com/dotnet/nightly/runtime-deps:%s {imageTag}" ;
96104 " -p" ; $" ContainerImageTags=\" %s {labels};%s {Software.Version.Normalize()}\" "
97105 " -p" ; $" ContainerRepository=elastic/%s {project}"
98106 ]
99107 let registry =
100- match Environment.environVarOrNone " GITHUB_ACTIONS " with
101- | None -> []
102- | Some _ -> [
103- " -p" ; " ContainerRegistry=ghcr.io "
104- " -p " ; " ContainerUser=1001:1001 " ;
105- ]
108+ match ( ci , pr ) with
109+ | Some _, None -> [
110+ " -p " ; " ContainerRegistry=ghcr.io "
111+ " -p" ; " ContainerUser=1001:1001 " ;
112+ ]
113+ | _, _ -> [ ]
106114 exec { run " dotnet" ( args @ registry) }
107115 createImage " docs-builder"
108116 createImage " docs-assembler"
0 commit comments