From 4d07f7a96fc9c3d525a6ea15f6f2aabe99cde0ce Mon Sep 17 00:00:00 2001 From: Arturo Contreras Date: Wed, 14 Apr 2021 18:14:42 -0600 Subject: [PATCH] Comment out image push and fix aircam bazel path --- gitops/bazel/bazeltargets.go | 3 ++- gitops/prer/create_gitops_prs.go | 41 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/gitops/bazel/bazeltargets.go b/gitops/bazel/bazeltargets.go index 272c63c5..be8736fb 100644 --- a/gitops/bazel/bazeltargets.go +++ b/gitops/bazel/bazeltargets.go @@ -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 } diff --git a/gitops/prer/create_gitops_prs.go b/gitops/prer/create_gitops_prs.go index 43e2ed17..7ffbabcd 100644 --- a/gitops/prer/create_gitops_prs.go +++ b/gitops/prer/create_gitops_prs.go @@ -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" @@ -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)