Skip to content

Commit

Permalink
updt-builder
Browse files Browse the repository at this point in the history
Signed-off-by: David Fridrich <[email protected]>
  • Loading branch information
gauron99 committed Feb 10, 2025
1 parent b581f13 commit 97186a4
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions hack/update-builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ import (
"net/http"
"os"
"os/exec"
"os/signal"
"path/filepath"
"regexp"
"slices"
"strings"
"syscall"

"golang.org/x/oauth2"
"golang.org/x/term"
Expand Down Expand Up @@ -47,18 +45,7 @@ import (
)

// this is effectively "main" function. This is the entry point to this file
func updateBuilder() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
go func() {
<-sigs
cancel()
<-sigs
os.Exit(130)
}()

func updateBuilder(ctx context.Context) error {
var hadError bool
for _, variant := range []string{"tiny", "base", "full"} {
fmt.Println("::group::" + variant)
Expand All @@ -70,8 +57,9 @@ func updateBuilder() {
fmt.Println("::endgroup::")
}
if hadError {
os.Exit(1)
return errors.New("failed to update builder")
}
return nil
}

func buildBuilderImage(ctx context.Context, variant, arch string) (string, error) {
Expand Down

0 comments on commit 97186a4

Please sign in to comment.