Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iwangjintian committed Jun 4, 2024
1 parent fc86fa3 commit 4c17c85
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test/localenv/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strings"
"sync"
"time"
Expand All @@ -39,6 +40,8 @@ const (
LOG_ROOT = "/tmp/symphony-integration-test-logs"
)

var platform = fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)

// Print parameters for mage local testing
func PrintParams() error {
fmt.Println("OSS_CONTAINER_REGISTRY: ", getContainerRegistry())
Expand Down Expand Up @@ -388,13 +391,16 @@ func (Build) Api() error {
return buildAPI()
}
func buildAPI() error {
return shellcmd.Command("docker buildx build --platform \"linux/amd64\" -f ../../api/Dockerfile -t \"ghcr.io/eclipse-symphony/symphony-api\" \"../..\" --load").Run() //oss
imageName := "ghcr.io/eclipse-symphony/symphony-api"
return shellcmd.Command(fmt.Sprintf("docker buildx build --platform %s -f ../../api/Dockerfile -t %s \"../..\" --load", platform, imageName)).Run() //oss
}

func buildAgent() error {
pollAgentImageName := "ghcr.io/eclipse-symphony/symphony-poll-agent"
targetAgentImageName := "ghcr.io/eclipse-symphony/symphony-target-agent"
return shellcmd.RunAll(
shellcmd.Command("docker buildx build --platform \"linux/amd64\" -f ../../api/Dockerfile.poll-agent -t \"ghcr.io/eclipse-symphony/symphony-poll-agent\" \"../..\" --load"),
shellcmd.Command("docker buildx build --platform \"linux/amd64\" -f ../../api/Dockerfile.target-agent -t \"ghcr.io/eclipse-symphony/symphony-target-agent\" \"../..\" --load"),
shellcmd.Command(fmt.Sprintf("docker buildx build --platform %s -f ../../api/Dockerfile.poll-agent -t %s \"../..\" --load", platform, pollAgentImageName)),
shellcmd.Command(fmt.Sprintf("docker buildx build --platform %s -f ../../api/Dockerfile.target-agent -t %s \"../..\" --load", platform, targetAgentImageName)),
) //oss
}

Expand All @@ -403,7 +409,8 @@ func (Build) K8s() error {
return buildK8s()
}
func buildK8s() error {
return shellcmd.Command("docker buildx build --platform \"linux/amd64\" -f ../../k8s/Dockerfile -t \"ghcr.io/eclipse-symphony/symphony-k8s\" \"../..\" --load").Run() //oss
imageName := "ghcr.io/eclipse-symphony/symphony-k8s"
return shellcmd.Command(fmt.Sprintf("docker buildx build --platform %s -f ../../k8s/Dockerfile -t %s \"../..\" --load", platform, imageName)).Run() //oss
}

/******************** Minikube ********************/
Expand Down

0 comments on commit 4c17c85

Please sign in to comment.