From 29762d741379753b231389e8ca07830283ed70d2 Mon Sep 17 00:00:00 2001 From: dx-tan Date: Tue, 26 Dec 2023 18:44:25 +0700 Subject: [PATCH] Remove: key --- deploy_images.py | 10 ++++++---- deploy_images.sh | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/deploy_images.py b/deploy_images.py index 2de1774..242016e 100644 --- a/deploy_images.py +++ b/deploy_images.py @@ -5,11 +5,13 @@ import string import os import boto3 from datetime import datetime +from dotenv import load_dotenv +load_dotenv(".env_prod") BASH_FILE = './deploy_images.sh' S3_ENDPOINT = "" -S3_ACCESS_KEY = "secret" -S3_SECRET_KEY = "secret" +S3_ACCESS_KEY = os.getenv('S3_ACCESS_KEY') +S3_SECRET_KEY = os.getenv('S3_SECRET_KEY') S3_BUCKET = "ocr-deployment-config" class MinioS3Client: @@ -77,8 +79,8 @@ def deploy(): # Define the variable tag = str(random_hash()[:8]) now = datetime.now() - # tag = tag + "_" + str(now.strftime("%d%m%y%H%M%S")) - tag = "4cae5134_261223123256" + tag = tag + "_" + str(now.strftime("%d%m%y%H%M%S")) + # tag = "4cae5134_261223123256" print(tag) # Execute the Bash script with the variable as a command-line argument diff --git a/deploy_images.sh b/deploy_images.sh index b0b8195..07a1c02 100755 --- a/deploy_images.sh +++ b/deploy_images.sh @@ -5,20 +5,20 @@ tag=$1 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 public.ecr.aws/v4n9y6r8/sidp/cope2n-ai-fi-sbt:${tag} -# docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-ai-fi-sbt:${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 public.ecr.aws/v4n9y6r8/sidp/cope2n-ai-fi-sbt:${tag} +docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-ai-fi-sbt:${tag} -# 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 public.ecr.aws/v4n9y6r8/sidp/cope2n-be-fi-sbt:${tag} -# docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-be-fi-sbt:${tag} +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 public.ecr.aws/v4n9y6r8/sidp/cope2n-be-fi-sbt:${tag} +docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-be-fi-sbt:${tag} -# 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 public.ecr.aws/v4n9y6r8/sidp/cope2n-fe-fi-sbt:${tag} -# docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-fe-fi-sbt:${tag} +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 public.ecr.aws/v4n9y6r8/sidp/cope2n-fe-fi-sbt:${tag} +docker push public.ecr.aws/v4n9y6r8/sidp/cope2n-fe-fi-sbt:${tag} cp ./docker-compose-prod.yml ./docker-compose_${tag}.yml sed -i "s/{{tag}}/$tag/g" ./docker-compose_${tag}.yml