diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index c25667e0..d204b1a8 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -13,7 +13,6 @@ on: name: Building Package jobs: build: - environment: builder runs-on: ubuntu-latest steps: - name: Register diff --git a/infra/builder-worker/src/builder-worker.ts b/infra/builder-worker/src/builder-worker.ts index 1cc6478e..2df0b120 100644 --- a/infra/builder-worker/src/builder-worker.ts +++ b/infra/builder-worker/src/builder-worker.ts @@ -72,7 +72,7 @@ export class BuilderWorker { owner: "maxmcd", repo: "bramble", workflow_id: ".github/workflows/builder.yml", - ref: "infra-2", + ref: "main", inputs: { ...body, JobID: id }, }, ); diff --git a/internal/command/cli.go b/internal/command/cli.go index 78729605..ca1c2f70 100644 --- a/internal/command/cli.go +++ b/internal/command/cli.go @@ -391,7 +391,6 @@ their public functions with documentation. If an immediate subdirectory has a drvs = append(drvs, drv) } // TODO: replace with something generally usable - fmt.Println(len(os.Getenv("DIGITALOCEAN_SPACES_ACCESS_ID")), len(os.Getenv("DIGITALOCEAN_SPACES_SECRET_KEY"))) s3 := simples3.New("", os.Getenv("DIGITALOCEAN_SPACES_ACCESS_ID"), os.Getenv("DIGITALOCEAN_SPACES_SECRET_KEY")) diff --git a/internal/command/integration_test.go b/internal/command/integration_test.go index e86110f0..06fc22b4 100644 --- a/internal/command/integration_test.go +++ b/internal/command/integration_test.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "net/http" "net/http/httptest" "os" "path/filepath" @@ -133,37 +132,37 @@ func TestRun(t *testing.T) { } } -func TestDep_handler(t *testing.T) { - initIntegrationTest(t) - app := cliApp(".") - ctx, cancel := context.WithCancel(context.Background()) - errChan := make(chan error) - test.SetEnv(t, "BRAMBLE_PATH", t.TempDir()) - go func() { - if err := app.RunContext(ctx, []string{"bramble", "server"}); err != nil { - errChan <- err - } - }() - t.Cleanup(func() { cancel() }) - for { - resp, _ := http.Get("http://localhost:2726") - if resp != nil { - resp.Body.Close() - } - if resp != nil && resp.StatusCode == http.StatusNotFound { - break - } - select { - case err := <-errChan: - t.Fatal(err) - default: - } - } - // TODO: this actually pulls from github, no network access in tests - if err := app.RunContext(ctx, []string{"bramble", "publish", "github.com/maxmcd/busybox"}); err != nil { - t.Fatal(err) - } -} +// TODO: don't hit the real build server +// func TestDep_handler(t *testing.T) { +// initIntegrationTest(t) +// app := cliApp(".") +// ctx, cancel := context.WithCancel(context.Background()) +// errChan := make(chan error) +// test.SetEnv(t, "BRAMBLE_PATH", t.TempDir()) +// go func() { +// if err := app.RunContext(ctx, []string{"bramble", "server"}); err != nil { +// errChan <- err +// } +// }() +// t.Cleanup(func() { cancel() }) +// for { +// resp, _ := http.Get("http://localhost:2726") +// if resp != nil { +// resp.Body.Close() +// } +// if resp != nil && resp.StatusCode == http.StatusNotFound { +// break +// } +// select { +// case err := <-errChan: +// t.Fatal(err) +// default: +// } +// } +// if err := app.RunContext(ctx, []string{"bramble", "publish", "github.com/maxmcd/busybox"}); err != nil { +// t.Fatal(err) +// } +// } func TestBuildAllFunction(t *testing.T) { initIntegrationTest(t) diff --git a/internal/dependency/dependency.go b/internal/dependency/dependency.go index a9a35dcc..83d8f9ac 100644 --- a/internal/dependency/dependency.go +++ b/internal/dependency/dependency.go @@ -172,7 +172,6 @@ func PostJob(ctx context.Context, url, pkg, reference string) (err error) { return err } dur := (time.Millisecond * 1000) - count := 0 fmt.Println("Waiting for build result...") for { select { @@ -180,11 +179,6 @@ func PostJob(ctx context.Context, url, pkg, reference string) (err error) { return context.Canceled default: } - if count > 5 { - // Many jobs finish quickly, but if they don't, we can check less - // often - dur = time.Second - } job, err := dc.getJob(context.Background(), id) if err != nil { return err @@ -197,7 +191,6 @@ func PostJob(ctx context.Context, url, pkg, reference string) (err error) { fmt.Printf("Build complete in %s\n", job.End.Sub(job.Start)) break } - count++ time.Sleep(dur) } return nil