MCPcopy Create free account
hub / github.com/Scalingo/cli / uploadArchive

Function uploadArchive

deployments/deploy.go:107–120  ·  view source on GitHub ↗
(ctx context.Context, uploadURL string, archiveReader io.Reader, archiveSize int64)

Source from the content-addressed store, hash-verified

105}
106
107func uploadArchive(ctx context.Context, uploadURL string, archiveReader io.Reader, archiveSize int64) (*http.Response, error) {
108 scalingoio.Status("Uploading archive…")
109 req, err := http.NewRequestWithContext(ctx, "PUT", uploadURL, archiveReader)
110 if err != nil {
111 return nil, errors.Wrapf(ctx, err, "fail to create the PUT request to upload the WAR archive")
112 }
113
114 req.Header.Set("Content-Type", "application/x-gzip")
115 req.ContentLength = archiveSize
116
117 debug.Println("Uploading archive to ", uploadURL, "with headers", req.Header)
118
119 return http.DefaultClient.Do(req)
120}
121
122func showQueuedWarnings(ctx context.Context, client *scalingo.Client, appID, deploymentID string) {
123 for {

Callers 2

DeployWarFunction · 0.85
uploadArchivePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected