From 4007b8411c3da7c27f5db0985a8362725dea09b5 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Tue, 16 Jul 2024 17:12:16 +0200 Subject: [PATCH] new ecr url, better error messages, path fixes --- Dockerfile | 2 +- api/controller.go | 2 +- api/default-templates/ecs-deploy-task.json | 3 ++- provider/ecs/marketplace.go | 5 +++++ templates/iam/ecs-deploy-task.json | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb23abb..009de55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/api/controller.go b/api/controller.go index 4d8d5d1..09c42a5 100644 --- a/api/controller.go +++ b/api/controller.go @@ -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, diff --git a/api/default-templates/ecs-deploy-task.json b/api/default-templates/ecs-deploy-task.json index 58fffc0..e6b2480 100644 --- a/api/default-templates/ecs-deploy-task.json +++ b/api/default-templates/ecs-deploy-task.json @@ -52,7 +52,8 @@ "application-autoscaling:DeregisterScalableTarget", "application-autoscaling:DescribeScalableTargets", "application-autoscaling:DescribeScalingPolicies", - "application-autoscaling:DeleteScalingPolicy" + "application-autoscaling:DeleteScalingPolicy", + "aws-marketplace:RegisterUsage" ], "Resource": "*" }, diff --git a/provider/ecs/marketplace.go b/provider/ecs/marketplace.go index d689f32..8ac1efc 100644 --- a/provider/ecs/marketplace.go +++ b/provider/ecs/marketplace.go @@ -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" @@ -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) } diff --git a/templates/iam/ecs-deploy-task.json b/templates/iam/ecs-deploy-task.json index 58fffc0..e6b2480 100644 --- a/templates/iam/ecs-deploy-task.json +++ b/templates/iam/ecs-deploy-task.json @@ -52,7 +52,8 @@ "application-autoscaling:DeregisterScalableTarget", "application-autoscaling:DescribeScalableTargets", "application-autoscaling:DescribeScalingPolicies", - "application-autoscaling:DeleteScalingPolicy" + "application-autoscaling:DeleteScalingPolicy", + "aws-marketplace:RegisterUsage" ], "Resource": "*" },