Skip to content

Commit

Permalink
chore: ignore go push for now
Browse files Browse the repository at this point in the history
  • Loading branch information
markphelps committed Dec 25, 2023
1 parent f5b6982 commit aa83687
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,30 +153,8 @@ func goBuild(ctx context.Context, client *dagger.Client, hostDirectory *dagger.D
WithExec([]string{"go", "install", "-v", "github.com/cloudsmith-io/gopack@latest"}).
WithExec([]string{"gopack", version, "/app"})

var err error

if !push {
_, err = container.Sync(ctx)
return err
}

if os.Getenv("GOMOD_API_KEY") == "" {
return fmt.Errorf("GO_API_KEY is not set")
}

goModAPIKey := client.SetSecret("go-api-key", os.Getenv("GOMOD_API_KEY"))

goModHost := os.Getenv("GOMOD_HOST")
if goModHost == "" {
// TODO: remove this when we push to our own repository
return fmt.Errorf("GOMOD_HOST is not set")
}

// TODO: This will probably change when we push to our repository
_, err = container.
WithSecretVariable("GOMOD_API_KEY", goModAPIKey).
WithExec([]string{"curl", "-v", "--user", fmt.Sprintf("%s:%s", "user", os.Getenv("GOMOD_API_KEY")), "--upload-file", fmt.Sprintf("/app/%s.zip", version), fmt.Sprintf("%s://%s", protocol, goModHost)}).Sync(ctx)

// TODO: push
_, err := container.Sync(ctx)
return err
}

Expand Down

0 comments on commit aa83687

Please sign in to comment.