Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions build/Build.Docker.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Builds the `datalust/seqcli-ci` Docker images for linux/amd64 and linux/arm64, and, when
# Builds the `datalust/seqcli` Docker images for linux/amd64 and linux/arm64, and, when
# DOCKER_TOKEN is set, pushes them along with a multi-arch manifest.
#
# In CI (see publish-docker in .github/workflows/publish.yml) this runs against the commit that the
Expand Down Expand Up @@ -31,7 +31,7 @@ function Build-DockerImage($arch)
& dotnet publish src/SeqCli/SeqCli.csproj -c Release -f $framework -r $rid --self-contained /p:VersionPrefix=$version /p:PublishSingleFile=true
if($LASTEXITCODE -ne 0) { exit 2 }

& docker buildx build --platform "$($arch.platform)" -f dockerfiles/seqcli/$rid.Dockerfile -t "$image-ci:$version-$($arch.rid)" .
& docker buildx build --platform "$($arch.platform)" -f dockerfiles/seqcli/$rid.Dockerfile -t "$image:$version-$($arch.rid)" .
if($LASTEXITCODE -ne 0) { exit 3 }
}

Expand All @@ -49,7 +49,7 @@ function Publish-DockerImage($arch)
{
$ErrorActionPreference = "SilentlyContinue"

& docker push "$image-ci:$version-$($arch.rid)"
& docker push "$image:$version-$($arch.rid)"
if($LASTEXITCODE -ne 0) { exit 3 }

$ErrorActionPreference = "Stop"
Expand All @@ -59,14 +59,14 @@ function Publish-DockerManifest($archs)
{
$images = ""
foreach ($arch in $archs) {
$images += "$image-ci:$version-$($arch.rid) "
$images += "$image:$version-$($arch.rid) "
}

# We use `invoke-expression` here so each tag is treated as a separate arg
invoke-expression "docker manifest create $image-ci:$version $images"
invoke-expression "docker manifest create $image:$version $images"
if ($LASTEXITCODE) { exit 4 }

docker manifest push $image-ci:$version
docker manifest push $image:$version
if ($LASTEXITCODE) { exit 4 }
}

Expand Down
8 changes: 3 additions & 5 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This directory holds the PowerShell scripts that build, test, package, and publi
| `Build.Common.ps1` | (dot-sourced by the others) | Version number helpers |
| `Build.Windows.ps1` | Windows | Release archives for every platform, the `seqcli` .NET tool package, generated docs |
| `Build.Linux.ps1` | Linux | Nothing; runs the unit tests and the end-to-end tests against a Seq Docker container |
| `Build.Docker.ps1` | Linux | `datalust/seqcli-ci` Docker images for `linux/amd64` and `linux/arm64` |
| `Build.Docker.ps1` | Linux | `datalust/seqcli` Docker images for `linux/amd64` and `linux/arm64` |
| `Build.Npm.ps1` | Linux (any OS locally) | `@datalust/seqcli` and `@datalust/seqcli-<rid>` npm packages |
| `Build.Release.ps1` | Linux (any OS locally) | Draft GitHub release `v<version>` with the CI artifacts attached |

Expand Down Expand Up @@ -69,12 +69,10 @@ NuGet and npm use [trusted publishing](https://learn.microsoft.com/nuget/nuget-o
|---|---|---|---|---|
| Pull request | no | no | no | no |
| Push to `dev` | no | no | no | no |
| Push to `main` | yes, `v<version>` | release version | `datalust/seqcli-ci:<version>` | release, dist-tag `latest` |
| Manual run, `publish` checked | yes (prerelease unless on `main`) | prerelease version unless on `main` | `datalust/seqcli-ci:<version>` | prerelease (dist-tag `dev`) unless on `main` |
| Push to `main` | yes, `v<version>` | release version | `datalust/seqcli:<version>` | release, dist-tag `latest` |
| Manual run, `publish` checked | yes (prerelease unless on `main`) | prerelease version unless on `main` | `datalust/seqcli:<version>` | prerelease (dist-tag `dev`) unless on `main` |
| Manual run, `publish` unchecked | no (CI skips its jobs) | no | no | no |

Note that `Build.Docker.ps1` always pushes to the `datalust/seqcli-ci` repository (the image name with a `-ci` suffix), never directly to `datalust/seqcli`. Promoting an image to the public `datalust/seqcli` repository, and tagging it `latest`, is a separate step outside this repository.

To publish a release from `dev` (for example a preview build), run the workflow manually from the Actions tab with the **Publish a GitHub release and packages** input checked; this also publishes to NuGet, npm and Docker Hub. The release is marked as a prerelease because the branch is not `main`.

## Running the builds locally
Expand Down