Skip to content

Commit

Permalink
Allow publishing only 1 platform for docker/gstreamer images
Browse files Browse the repository at this point in the history
  • Loading branch information
biglittlebigben committed Jan 11, 2024
1 parent 03b2cbb commit 052bc88
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ const (
libniceVersion = "0.1.21"
chromiumVersion = "117.0.5874.0"
dockerBuild = "docker build"
dockerBuildX = "docker buildx build --push --platform linux/amd64,linux/arm64"
dockerBuildX = "docker buildx build --push --platform "
)

var (
platforms = map[string]string{
"all": "linux/amd64,linux/arm64",
"amd64": "linux/amd64",
"arm64": "linux/arm64",
}
)

type packageInfo struct {
Expand Down Expand Up @@ -137,12 +145,12 @@ func BuildChrome() error {
)
}

func PublishChrome() error {
func PublishChrome(env string) error {
return mageutil.Run(context.Background(),
"docker pull ubuntu:22.04",
fmt.Sprintf(
"%s -t livekit/chrome-installer:%s ./build/chrome",
dockerBuildX, chromiumVersion,
"%s%s -t livekit/chrome-installer:%s ./build/chrome",
dockerBuildX, platforms[env], chromiumVersion,
),
)
}
Expand All @@ -158,8 +166,8 @@ func BuildGStreamer() error {
return buildGstreamer(dockerBuild)
}

func PublishGStreamer() error {
return buildGstreamer(dockerBuildX)
func PublishGStreamer(env string) error {
return buildGstreamer(dockerBuildX + platforms[env])
}

func buildGstreamer(cmd string) error {
Expand Down

0 comments on commit 052bc88

Please sign in to comment.