Documentation
¶
Index ¶
- Constants
- Variables
- func CleanupZipFiles() error
- func CreateZipsFromFileInfos(fileInfos []FileInfo) ([]string, error)
- func CreateZipsInBatches(files []contracts.FileOps) ([]string, error)
- func InitTimingSummary()
- func NewCmd(f *cmdutil.Factory) *cobra.Command
- func NewCobraCmd(deploy *DeployCmd) *cobra.Command
- func NewV6Cmd(f *cmdutil.Factory) *cobra.Command
- func ReadAllFiles(pathStatic string, cmd *DeployCmd) ([]contracts.FileOps, error)
- func ReadZip() ([]contracts.FileOps, error)
- func TimeAPICall(name string, fn func() error) error
- func TimeAPICallWithResult[T any](name string, fn func() (T, error)) (T, error)
- func Worker(jobs <-chan contracts.FileOps, results chan<- error, currentFile *int64, ...)
- type APICallTiming
- type DeployCmd
- type ExternalDeployer
- type FileInfo
- type Response
- type TimingSummary
Constants ¶
const ( DeployURL = "https://console.azion.com" ScriptID = "17ac912d-5ce9-4806-9fa7-480779e43f58" )
Variables ¶
var ResponseMap map[string]string
var (
Retries int64
)
Functions ¶
func CleanupZipFiles ¶
func CleanupZipFiles() error
func CreateZipsFromFileInfos ¶
CreateZipsFromFileInfos creates ZIP files in batches from FileInfo slices This function opens files in batches to avoid "too many open files" error
func InitTimingSummary ¶
func InitTimingSummary()
InitTimingSummary initializes the global timing summary
func NewCobraCmd ¶
func NewV6Cmd ¶
NewV6Cmd is `azion deploy` for API v6 accounts: the v6 pipeline with --local or --dry-run, and otherwise the same remote deploy as v4, on the same script runner script.
func ReadAllFiles ¶
ReadAllFiles is kept for backward compatibility but now processes files in batches
func TimeAPICall ¶
TimeAPICall is a helper function to time an API call and record it
func TimeAPICallWithResult ¶
TimeAPICallWithResult is a helper function to time an API call that returns a result and record it
Types ¶
type APICallTiming ¶
APICallTiming holds timing information for individual API calls
type DeployCmd ¶
type DeployCmd struct {
Io *iostreams.IOStreams
GetWorkDir func() (string, error)
FileReader func(path string) ([]byte, error)
WriteFile func(filename string, data []byte, perm fs.FileMode) error
GetAzionJsonContent func(pathConfig string) (*contracts.AzionApplicationOptions, error)
WriteAzionJsonContent func(conf *contracts.AzionApplicationOptions, confConf string) error
WriteAzionConfig func(conf *contracts.AzionConfig) error
BuildCmd func(f *cmdutil.Factory) *build.BuildCmd
Open func(name string) (*os.File, error)
FilepathWalk func(root string, fn filepath.WalkFunc) error
F *cmdutil.Factory
Unmarshal func(data []byte, v interface{}) error
Interpreter func() *manifestInt.ManifestInterpreter
VersionID func() string
CallScript func(token string, id string, secret string, prefix string, name, confDir string, cmd *DeployCmd) (string, error)
OpenBrowser func(f *cmdutil.Factory, urlConsoleDeploy string, cmd *DeployCmd) error
CaptureLogs func(execId string, token string, cmd *DeployCmd) error
CheckToken func(f *cmdutil.Factory) error
ReadSettings func(path string) (token.Settings, error)
UploadFiles func(f *cmdutil.Factory, conf *contracts.AzionApplicationOptions, msgs *[]string, pathStatic, bucket string, cmd *DeployCmd, settings token.Settings) error
OpenBrowserFunc func(input string) error
// SaveResult stores what the script runner's deploy returns (azion.json
// and azion.config); DeployedURL reads the URL to show once it is saved.
// Nil means the v4 format (saveResultV4, deployedURLV4); the v6 deploy
// sets its own, since its azion.json has another format.
SaveResult func(body []byte, cmd *DeployCmd) error
DeployedURL func(cmd *DeployCmd) (url, workloadDomain string, err error)
Auto bool
DryRun bool
Env string
Local bool
NoPrompt bool
Path string
ProjectConf string
SkipBuild bool
SkipFramework bool
Sync bool
Workers int
AliasEnv bool
ConfigFile string
WriteBucket bool
Logs contracts.Logs
Result contracts.ResultsV4
}
func NewDeployCmd ¶
func (*DeployCmd) ExternalRun ¶
type ExternalDeployer ¶
type ExternalDeployer interface {
ExternalRun(f *cmdutil.Factory, configPath string, sync, local, skipFramework, aliasEnv bool) error
}
ExternalDeployer is the deploy init and link start when the user asks to deploy right away.
func NewExternalDeployer ¶
func NewExternalDeployer(f *cmdutil.Factory) ExternalDeployer
NewExternalDeployer picks the deploy for the account's API generation, so a v6 account never runs the v4 pipeline from init or link.
type Response ¶
type Response struct {
UUID string `json:"uuid"`
Image string `json:"image"`
Start time.Time `json:"start"`
}
Response represents the structure of the response from the API.
type TimingSummary ¶
type TimingSummary struct {
TotalDeployTime time.Duration
BucketCreateTime time.Duration
CredentialsTime time.Duration
UploadFilesTime time.Duration
ScriptCallTime time.Duration
LogsCaptureTime time.Duration
APICallTimes []APICallTiming
// contains filtered or unexported fields
}
TimingSummary holds the timing information for each phase of the deploy process
var GlobalTimingSummary *TimingSummary
GlobalTimingSummary is the global timing summary for the deploy process
func (*TimingSummary) AddAPICallTime ¶
func (ts *TimingSummary) AddAPICallTime(name string, duration time.Duration)
AddAPICallTime adds an API call timing to the summary
func (*TimingSummary) GetTotalTime ¶
func (ts *TimingSummary) GetTotalTime() time.Duration
GetTotalTime returns the total deploy time
func (*TimingSummary) PrintSummary ¶
func (ts *TimingSummary) PrintSummary()
PrintSummary prints the timing summary in debug format