(image string)
| 37 | } |
| 38 | |
| 39 | func (c *Command) pushDockerImage(image string) error { |
| 40 | console.Info("Authenticating to push to ECR Repository...") |
| 41 | |
| 42 | // docker login |
| 43 | userName, password, proxyURL, err := c.awsClient.ECR().GetDockerLogin() |
| 44 | if err != nil { |
| 45 | return fmt.Errorf("Failed to retrieve docker login info: %s", err.Error()) |
| 46 | } |
| 47 | if err := c.dockerClient.Login(userName, password, proxyURL); err != nil { |
| 48 | return fmt.Errorf("Docker login [%s] failed: %s", userName, err.Error()) |
| 49 | } |
| 50 | |
| 51 | // docker push |
| 52 | console.ProcessingOnResource("Pushing Docker image", image, true) |
| 53 | if err = c.dockerClient.PushImage(image); err != nil { |
| 54 | return fmt.Errorf("Failed to push Docker image [%s]: %s", image, err.Error()) |
| 55 | } |
| 56 | |
| 57 | return nil |
| 58 | } |
no test coverage detected