Skip to content

Commit

Permalink
new ecr url, better error messages, path fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wardviaene committed Jul 16, 2024
1 parent 9c45f5b commit 4007b84
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ WORKDIR /app

COPY . .
COPY --from=go-builder /ecs-deploy/ecs-deploy .
COPY --from=webapp-builder /webapp/dist webapp/dist
COPY --from=webapp-builder /webapp/dist/browser webapp/dist

RUN echo ${SOURCE_COMMIT} > source_commit

Expand Down
2 changes: 1 addition & 1 deletion api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ func (c *Controller) Bootstrap(b *Flags) error {
ContainerName: "ecs-deploy",
ContainerPort: 8080,
ContainerImage: "ecs-deploy",
ContainerURI: "index.docker.io/in4it/ecs-deploy:latest",
ContainerURI: "public.ecr.aws/y9x3p3i6/ecs-deploy:latest",
Essential: true,
MemoryReservation: 128,
CPUReservation: 64,
Expand Down
3 changes: 2 additions & 1 deletion api/default-templates/ecs-deploy-task.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"application-autoscaling:DeregisterScalableTarget",
"application-autoscaling:DescribeScalableTargets",
"application-autoscaling:DescribeScalingPolicies",
"application-autoscaling:DeleteScalingPolicy"
"application-autoscaling:DeleteScalingPolicy",
"aws-marketplace:RegisterUsage"
],
"Resource": "*"
},
Expand Down
5 changes: 5 additions & 0 deletions provider/ecs/marketplace.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ecs
import (
"fmt"
"os"
"strings"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
Expand Down Expand Up @@ -30,6 +31,10 @@ func (a *Marketplace) RegisterMarketplace() error {
})

if err != nil {
if strings.Contains(err.Error(), "CustomerNotEntitledException") {
fmt.Printf("Exited: no valid subscription found. Subscribe for ecs-deploy on the AWS Marketplace.")
os.Exit(1)
}
return fmt.Errorf("RegisterUsage error: %s", err)
}

Expand Down
3 changes: 2 additions & 1 deletion templates/iam/ecs-deploy-task.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"application-autoscaling:DeregisterScalableTarget",
"application-autoscaling:DescribeScalableTargets",
"application-autoscaling:DescribeScalingPolicies",
"application-autoscaling:DeleteScalingPolicy"
"application-autoscaling:DeleteScalingPolicy",
"aws-marketplace:RegisterUsage"
],
"Resource": "*"
},
Expand Down

0 comments on commit 4007b84

Please sign in to comment.