// Copyright 2026 MarketAlly. All rights reserved. // SPDX-License-Identifier: MIT // Package main provides the upload-helper CLI tool for reliable file uploads. package main import ( "flag" "fmt" "os" "git.marketally.com/gitcaddy/gitcaddy-runner/internal/pkg/artifact" ) func main() { url := flag.String("url", "", "Upload URL") token := flag.String("token", "", "Auth token") file := flag.String("file", "", "File to upload") retries := flag.Int("retries", 5, "Maximum retry attempts") flag.Parse() if *url == "" || *token == "" || *file == "" { fmt.Fprintf(os.Stderr, "GitCaddy Upload Helper - Reliable file uploads with retry\n\n") fmt.Fprintf(os.Stderr, "Usage: gitcaddy-upload -url URL -token TOKEN -file FILE\n\n") fmt.Fprintf(os.Stderr, "Options:\n") flag.PrintDefaults() os.Exit(1) } helper := artifact.NewUploadHelper() helper.MaxRetries = *retries if err := helper.UploadWithRetry(*url, *token, *file); err != nil { fmt.Fprintf(os.Stderr, "Upload failed: %v\n", err) os.Exit(1) } fmt.Println("Upload succeeded!") }