Skip to content

Commit

Permalink
Bump Bullseye from 3.3.0 to 4.2.1 (#291)
Browse files Browse the repository at this point in the history
* Bump Bullseye from 3.3.0 to 4.2.1

Bumps [Bullseye](https://github.com/adamralph/bullseye) from 3.3.0 to 4.2.1.
- [Changelog](https://github.com/adamralph/bullseye/blob/main/CHANGELOG.md)
- [Commits](adamralph/bullseye@3.3.0...4.2.1)

---
updated-dependencies:
- dependency-name: Bullseye
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update changelog

Signed-off-by: dependabot[bot] <support@github.com>

* Fix compile errors

Signed-off-by: Thomas Farr <tsfarr@amazon.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Thomas Farr <tsfarr@amazon.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Farr <tsfarr@amazon.com>
  • Loading branch information
3 people authored Jul 24, 2023
1 parent 5048ba2 commit 44f60ec
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 86 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Bumps `BenchMarkDotNet` from 0.13.5 to 0.13.6
- Bumps `Microsoft.NET.Test.Sdk` from 17.6.2 to 17.6.3
- Bumps `AWSSDK.Core` from 3.7.106.29 to 3.7.200.3
- Bumps `Bullseye` from 3.3.0 to 4.2.1

## [1.4.0]
### Added
Expand Down
173 changes: 88 additions & 85 deletions build/scripts/Targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
namespace Scripts

open System
open System.Collections.Generic
open System.IO

open Bullseye
Expand All @@ -40,7 +41,7 @@ module Main =
let private target name action = Targets.Target(name, Action(action))
let private skip name = printfn "SKIPPED target '%s' evaluated not to run" name |> ignore
let private conditional name optional action = target name (if optional then action else (fun _ -> skip name))
let private command name dependencies action = Targets.Target(name, dependencies, Action(action))
let private command name (dependencies: IEnumerable<string>) action = Targets.Target(name, dependencies, Action(action))
let private conditionalCommand name dependencies optional action = command name dependencies (if optional then action else (fun _ -> skip name))

/// <summary>Sets command line environments indicating we are building from the command line</summary>
Expand All @@ -58,89 +59,91 @@ module Main =


let [<EntryPoint>] main args =
async {
do! Async.SwitchToThreadPool ()

setCommandLineEnvVars ()

let parsed = Commandline.parse (args |> Array.toList)

let buildVersions = Versioning.BuildVersioning parsed
let artifactsVersion = Versioning.ArtifactsVersion buildVersions
Versioning.Validate parsed.Target buildVersions

let isCanary = parsed.Target = "canary";

Tests.SetTestEnvironmentVariables parsed

let testChain = ["clean"; "version"; "restore"; "full-build"; ]
let buildChain = ["test"; "inherit-doc" ]
let releaseChain =
[
"build";
"nuget-pack";
"nuget-pack-versioned";
"validate-artifacts";
"generate-release-notes"
]
let canaryChain = [ "version"; "release"; "test-nuget-package";]

// the following are expected to be called as targets directly
conditional "clean" (parsed.ReleaseBuild || parsed.Target = "clean") <| fun _ -> Build.Clean parsed
target "version" <| fun _ -> printfn "Artifacts Version: %O" artifactsVersion

target "restore" Build.Restore
target "full-build" <| fun _ -> Build.Compile parsed artifactsVersion

//TEST
conditionalCommand "test" testChain (not parsed.SkipTests && not isCanary) <| fun _ -> Tests.RunUnitTests parsed

target "inherit-doc" <| InheritDoc.PatchInheritDocs

//BUILD
command "build" buildChain <| fun _ -> printfn "STARTING BUILD"

target "nuget-pack" <| fun _ -> Build.Pack artifactsVersion

conditional "nuget-pack-versioned" (isCanary) <| fun _ -> Build.VersionedPack artifactsVersion

conditional "generate-release-notes" (not isCanary) <| fun _ -> ReleaseNotes.GenerateNotes buildVersions

target "validate-artifacts" <| fun _ -> Versioning.ValidateArtifacts artifactsVersion

//RELEASE
command "release" releaseChain <| fun _ ->
let outputPath = match parsed.CommandArguments with | Commandline.SetVersion c -> c.OutputLocation | _ -> None
match outputPath with
| None ->
printfn "Finished Release Build %O, artifacts available at: %s" artifactsVersion Paths.BuildOutput
| Some path ->
Fake.IO.Shell.cp_r Paths.BuildOutput path
let zipName = sprintf "opencsearch-net-%O.zip" artifactsVersion.Full
let outputZip = Path.Combine(path, zipName)
let files = !! (sprintf "%s/*.*" path) -- outputZip
Fake.IO.Zip.createZip "." outputZip "opensearch-project/opensearch-net artifact" 9 true files
printfn "Finished Release Build %O, output copied to: %s" artifactsVersion path

conditional "test-nuget-package" (not parsed.SkipTests) <| fun _ -> Tests.RunReleaseUnitTests artifactsVersion parsed

//CANARY
command "canary" canaryChain <| fun _ -> printfn "Finished Release Build %O" artifactsVersion

// ADDITIONAL COMMANDS

command "cluster" [ "restore"; "full-build" ] <| fun _ ->
ReposTooling.LaunchCluster parsed

command "codegen" [ ] <| fun _ ->
ReposTooling.GenerateApi parsed.RemainingArguments

command "rest-spec-tests" [ ] <| fun _ ->
ReposTooling.RestSpecTests parsed.RemainingArguments

command "benchmark" [ "clean"; "full-build"; ] <| fun _ -> Benchmarker.Run parsed

command "integrate" [ "clean"; "restore"; "full-build";] <| fun _ -> Tests.RunIntegrationTests parsed

do! Targets.RunTargetsAndExitAsync([parsed.Target], (fun e -> e.GetType() = typeof<ProcExecException>)) |> Async.AwaitTask
} |> Async.RunSynchronously

setCommandLineEnvVars ()

let parsed = Commandline.parse (args |> Array.toList)

let buildVersions = Versioning.BuildVersioning parsed
let artifactsVersion = Versioning.ArtifactsVersion buildVersions
Versioning.Validate parsed.Target buildVersions

let isCanary = parsed.Target = "canary";

Tests.SetTestEnvironmentVariables parsed

let testChain = ["clean"; "version"; "restore"; "full-build"; ]
let buildChain = ["test"; "inherit-doc" ]
let releaseChain =
[
"build";
"nuget-pack";
"nuget-pack-versioned";
"validate-artifacts";
"generate-release-notes"
]
let canaryChain = [ "version"; "release"; "test-nuget-package";]

// the following are expected to be called as targets directly
conditional "clean" (parsed.ReleaseBuild || parsed.Target = "clean") <| fun _ -> Build.Clean parsed
target "version" <| fun _ -> printfn "Artifacts Version: %O" artifactsVersion

target "restore" Build.Restore
target "full-build" <| fun _ -> Build.Compile parsed artifactsVersion

//TEST
conditionalCommand "test" testChain (not parsed.SkipTests && not isCanary) <| fun _ -> Tests.RunUnitTests parsed

target "inherit-doc" <| InheritDoc.PatchInheritDocs

//BUILD
command "build" buildChain <| fun _ -> printfn "STARTING BUILD"

target "nuget-pack" <| fun _ -> Build.Pack artifactsVersion

conditional "nuget-pack-versioned" (isCanary) <| fun _ -> Build.VersionedPack artifactsVersion

conditional "generate-release-notes" (not isCanary) <| fun _ -> ReleaseNotes.GenerateNotes buildVersions

target "validate-artifacts" <| fun _ -> Versioning.ValidateArtifacts artifactsVersion

//RELEASE
command "release" releaseChain <| fun _ ->
let outputPath = match parsed.CommandArguments with | Commandline.SetVersion c -> c.OutputLocation | _ -> None
match outputPath with
| None ->
printfn "Finished Release Build %O, artifacts available at: %s" artifactsVersion Paths.BuildOutput
| Some path ->
Fake.IO.Shell.cp_r Paths.BuildOutput path
let zipName = sprintf "opencsearch-net-%O.zip" artifactsVersion.Full
let outputZip = Path.Combine(path, zipName)
let files = !! (sprintf "%s/*.*" path) -- outputZip
Fake.IO.Zip.createZip "." outputZip "opensearch-project/opensearch-net artifact" 9 true files
printfn "Finished Release Build %O, output copied to: %s" artifactsVersion path

conditional "test-nuget-package" (not parsed.SkipTests) <| fun _ -> Tests.RunReleaseUnitTests artifactsVersion parsed

//CANARY
command "canary" canaryChain <| fun _ -> printfn "Finished Release Build %O" artifactsVersion

// ADDITIONAL COMMANDS

command "cluster" [ "restore"; "full-build" ] <| fun _ ->
ReposTooling.LaunchCluster parsed

command "codegen" [ ] <| fun _ ->
ReposTooling.GenerateApi parsed.RemainingArguments

command "rest-spec-tests" [ ] <| fun _ ->
ReposTooling.RestSpecTests parsed.RemainingArguments

command "benchmark" [ "clean"; "full-build"; ] <| fun _ -> Benchmarker.Run parsed

command "integrate" [ "clean"; "restore"; "full-build";] <| fun _ -> Tests.RunIntegrationTests parsed

Targets.RunTargetsAndExit([parsed.Target], (fun e -> e.GetType() = typeof<ProcExecException>), ":")

0

2 changes: 1 addition & 1 deletion build/scripts/scripts.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<Content Include="..\..\.github\license-header-fs.txt"><Link>license-header-fs.txt</Link></Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Bullseye" Version="3.3.0" />
<PackageReference Include="Bullseye" Version="4.2.1" />
<ProjectReference Include="$(SolutionRoot)\abstractions\src\OpenSearch.OpenSearch.Managed\OpenSearch.OpenSearch.Managed.csproj" />

<PackageReference Include="Fake.Core.Environment" Version="6.0.0" />
Expand Down

0 comments on commit 44f60ec

Please sign in to comment.