(positionalArgs []string, dsHost string, flags *flag.FlagSet, cfTarget util.CloudFoundryTarget)
| 248 | } |
| 249 | |
| 250 | func (c *DeployCommand) executeInternal(positionalArgs []string, dsHost string, flags *flag.FlagSet, cfTarget util.CloudFoundryTarget) ExecutionStatus { |
| 251 | operationID := GetStringOpt(operationIDOpt, flags) |
| 252 | action := GetStringOpt(actionOpt, flags) |
| 253 | retries := GetUintOpt(retriesOpt, flags) |
| 254 | |
| 255 | if operationID != "" || action != "" { |
| 256 | return c.ExecuteAction(operationID, action, retries, dsHost, cfTarget) |
| 257 | } |
| 258 | |
| 259 | mtaElementsCalculator := createMtaElementsCalculator(flags) |
| 260 | |
| 261 | rawMtaArchive, err := c.getMtaArchive(positionalArgs, mtaElementsCalculator) |
| 262 | if err != nil { |
| 263 | ui.Failed("Error retrieving MTA: %s", err.Error()) |
| 264 | return Failure |
| 265 | } |
| 266 | |
| 267 | isUrl, mtaArchive := parseMtaArchiveArgument(rawMtaArchive) |
| 268 | |
| 269 | mtaNameToPrint := terminal.EntityNameColor(mtaArchive) |
| 270 | if isUrl { |
| 271 | mtaNameToPrint = "from url" |
| 272 | } |
| 273 | |
| 274 | // Print initial message |
| 275 | ui.Say("Deploying multi-target app archive %s in org %s / space %s as %s...\n", |
| 276 | mtaNameToPrint, terminal.EntityNameColor(cfTarget.Org.Name), terminal.EntityNameColor(cfTarget.Space.Name), |
| 277 | terminal.EntityNameColor(cfTarget.Username)) |
| 278 | |
| 279 | var uploadedArchivePartIds []string |
| 280 | var uploadStatus ExecutionStatus |
| 281 | var mtaId string |
| 282 | var disposableUserProvidedServiceName string |
| 283 | |
| 284 | // Check SLMP metadata |
| 285 | // TODO: ensure session |
| 286 | mtaClient := c.NewMtaClient(dsHost, cfTarget) |
| 287 | |
| 288 | namespace := strings.TrimSpace(GetStringOpt(namespaceOpt, flags)) |
| 289 | force := GetBoolOpt(forceOpt, flags) |
| 290 | conf := configuration.NewSnapshot() |
| 291 | uploadChunkSize := conf.GetUploadChunkSizeInMB() |
| 292 | sequentialUpload := conf.GetUploadChunksSequentially() |
| 293 | disableProgressBar := conf.GetDisableUploadProgressBar() |
| 294 | fileUploader := NewFileUploader(mtaClient, namespace, uploadChunkSize, sequentialUpload, disableProgressBar) |
| 295 | var yamlBytes []byte |
| 296 | |
| 297 | if isUrl { |
| 298 | var fileId string |
| 299 | var schemaVersion string |
| 300 | |
| 301 | asyncUploadJobResult := c.uploadFromUrl(mtaArchive, mtaClient, namespace, disableProgressBar) |
| 302 | if asyncUploadJobResult.ExecutionStatus == Failure { |
| 303 | return Failure |
| 304 | } |
| 305 | mtaId, fileId, schemaVersion = asyncUploadJobResult.MtaId, asyncUploadJobResult.FileId, asyncUploadJobResult.SchemaVersion |
| 306 | // Check for an ongoing operation for this MTA ID and abort it |
| 307 | wasAborted, err := c.CheckOngoingOperation(mtaId, namespace, dsHost, force, cfTarget) |
nothing calls this directly
no test coverage detected