From d6bccec51deb2c2f805129ebb4279e44d2e6f3c7 Mon Sep 17 00:00:00 2001 From: dx-tan Date: Thu, 11 Jan 2024 17:38:12 +0700 Subject: [PATCH] Add: redemtion id --- cope2n-api/fwd_api/api/ctel_view.py | 3 ++- .../fwd_api/models/SubscriptionRequest.py | 2 +- deploy_images.sh | 24 +++++++++---------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/cope2n-api/fwd_api/api/ctel_view.py b/cope2n-api/fwd_api/api/ctel_view.py index 6d4c632..ceeb64e 100755 --- a/cope2n-api/fwd_api/api/ctel_view.py +++ b/cope2n-api/fwd_api/api/ctel_view.py @@ -151,7 +151,8 @@ class CtelViewSet(viewsets.ViewSet): pages_left=total_page, process_type=p_type, status=1, request_id=rq_id, provider_code=provider_code, - subscription=sub) + subscription=sub, + redemption_id=validated_data["redemption_ID"]) new_request.save() count = 0 compact_files = [] diff --git a/cope2n-api/fwd_api/models/SubscriptionRequest.py b/cope2n-api/fwd_api/models/SubscriptionRequest.py index 6018274..3ac977d 100755 --- a/cope2n-api/fwd_api/models/SubscriptionRequest.py +++ b/cope2n-api/fwd_api/models/SubscriptionRequest.py @@ -10,7 +10,7 @@ class SubscriptionRequest(models.Model): pages_left: int = models.IntegerField(default=1) doc_type: str = models.CharField(max_length=100) request_id = models.CharField(max_length=200) # Change to request_id - redemption_id = models.CharField(max_length=200, null=True) # Change to request_id + redemption_id = models.CharField(max_length=200, null=True) process_type = models.CharField(max_length=200) # driver/id/invoice provider_code = models.CharField(max_length=200, default="Guest") # Request source FWD/CTel predict_result = models.JSONField(null=True) diff --git a/deploy_images.sh b/deploy_images.sh index 11e5360..3b57e42 100755 --- a/deploy_images.sh +++ b/deploy_images.sh @@ -11,24 +11,24 @@ echo "[INFO] Tag received from Python: $tag" echo "[INFO] Pushing AI image with tag: $tag..." docker compose -f docker-compose-dev.yml build cope2n-fi-sbt -docker tag sidp/cope2n-ai-fi-sbt:latest 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-ai-fi-sbt:${tag} -docker push 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-ai-fi-sbt:${tag} -# docker tag sidp/cope2n-ai-fi-sbt:latest 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-ai-fi-sbt:production -# docker push 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-ai-fi-sbt:production +docker tag sidp/cope2n-ai-fi-sbt:latest public.ecr.aws/sdsrv/sidp/cope2n-ai-fi-sbt:${tag} +docker push public.ecr.aws/sdsrv/sidp/cope2n-ai-fi-sbt:${tag} +# docker tag sidp/cope2n-ai-fi-sbt:latest public.ecr.aws/sdsrv/sidp/cope2n-ai-fi-sbt:production +# docker push public.ecr.aws/sdsrv/sidp/cope2n-ai-fi-sbt:production echo "[INFO] Pushing BE image with tag: $tag..." docker compose -f docker-compose-dev.yml build be-ctel-sbt -docker tag sidp/cope2n-be-fi-sbt:latest 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-be-fi-sbt:${tag} -# docker tag sidp/cope2n-be-fi-sbt:latest 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-be-fi-sbt:production -docker push 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-be-fi-sbt:${tag} -# docker push 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-be-fi-sbt:production +docker tag sidp/cope2n-be-fi-sbt:latest public.ecr.aws/sdsrv/sidp/cope2n-be-fi-sbt:${tag} +# docker tag sidp/cope2n-be-fi-sbt:latest public.ecr.aws/sdsrv/sidp/cope2n-be-fi-sbt:production +docker push public.ecr.aws/sdsrv/sidp/cope2n-be-fi-sbt:${tag} +# docker push public.ecr.aws/sdsrv/sidp/cope2n-be-fi-sbt:production echo "[INFO] Pushing FE image with tag: $tag..." docker compose -f docker-compose-dev.yml build fe-sbt -docker tag sidp/cope2n-fe-fi-sbt:latest 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-fe-fi-sbt:${tag} -# docker tag sidp/cope2n-fe-fi-sbt:latest 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-fe-fi-sbt:production -docker push 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-fe-fi-sbt:${tag} -# docker push 756281617842.dkr.ecr.ap-southeast-1.amazonaws.com/sidp/cope2n-fe-fi-sbt:production +docker tag sidp/cope2n-fe-fi-sbt:latest public.ecr.aws/sdsrv/sidp/cope2n-fe-fi-sbt:${tag} +# docker tag sidp/cope2n-fe-fi-sbt:latest public.ecr.aws/sdsrv/sidp/cope2n-fe-fi-sbt:production +docker push public.ecr.aws/sdsrv/sidp/cope2n-fe-fi-sbt:${tag} +# docker push public.ecr.aws/sdsrv/sidp/cope2n-fe-fi-sbt:production cp ./docker-compose-prod.yml ./docker-compose_${tag}.yml sed -i "s/{{tag}}/$tag/g" ./docker-compose_${tag}.yml