Skip to content
Open
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
3 changes: 2 additions & 1 deletion gitops/bazel/bazeltargets.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ func TargetToExecutable(target string) string {
if !strings.HasPrefix(target, "//") {
return target
}
target = "bazel-bin/" + target[2:]
// NOTE(arturo): Specific to aircam bazel, maybe figure out a better way to find right path
target = "build/bazel-bin/" + target[2:]
target = strings.Replace(target, ":", "/", 1)
return target
}
41 changes: 21 additions & 20 deletions gitops/prer/create_gitops_prs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"log"
"os"
oe "os/exec"
"strings"
"sync"
//"strings"
//"sync"

"github.com/adobe/rules_gitops/gitops/analysis"
"github.com/adobe/rules_gitops/gitops/bazel"
Expand Down Expand Up @@ -166,24 +166,25 @@ func main() {
}

// Push images
qr = bazelQuery(fmt.Sprintf("kind(k8s_container_push, deps(%s))", strings.Join(updatedGitopsTargets, " + ")))
targetsCh := make(chan string)
var wg sync.WaitGroup
wg.Add(*pushParallelism)
for i := 0; i < *pushParallelism; i++ {
go func() {
defer wg.Done()
for target := range targetsCh {
bin := bazel.TargetToExecutable(target)
exec.Mustex("", bin)
}
}()
}
for _, t := range qr.Results {
targetsCh <- t.Target.Rule.GetName()
}
close(targetsCh)
wg.Wait()
// (TODO:arturo) figure out why this doesn't quite work getting bazel file path errors
//qr = bazelQuery(fmt.Sprintf("kind(k8s_container_push, deps(%s))", strings.Join(updatedGitopsTargets, " + ")))
//targetsCh := make(chan string)
//var wg sync.WaitGroup
//wg.Add(*pushParallelism)
//for i := 0; i < *pushParallelism; i++ {
// go func() {
// defer wg.Done()
// for target := range targetsCh {
// bin := bazel.TargetToExecutable(target)
// exec.Mustex("", bin)
// }
// }()
//}
//for _, t := range qr.Results {
// targetsCh <- t.Target.Rule.GetName()
//}
//close(targetsCh)
//wg.Wait()

workdir.Push(updatedGitopsBranches)

Expand Down