From eba55629e30e6fd69a80dac1123448fef66d65d6 Mon Sep 17 00:00:00 2001 From: Sina Iman Date: Tue, 30 Jan 2024 05:35:29 -0800 Subject: [PATCH] repo service name --- .github/workflows/build-repo-server.yaml | 14 +++++++------- desci-repo/kubernetes/deployment.yaml | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-repo-server.yaml b/.github/workflows/build-repo-server.yaml index 28a649186..775633a58 100644 --- a/.github/workflows/build-repo-server.yaml +++ b/.github/workflows/build-repo-server.yaml @@ -116,7 +116,7 @@ jobs: # Build and tag the image docker build \ -t $CONTAINER_IMAGE:latest \ - -t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE \ + -t $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod \ ./desci-repo # Add additional steps here like scanning of image @@ -147,10 +147,10 @@ jobs: run: | # Push image to AWS ECR aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com - docker tag $CONTAINER_IMAGE:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE:${{ github.sha }} - docker tag $CONTAINER_IMAGE:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE:latest - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE:${{ github.sha }} - docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE:latest + docker tag $CONTAINER_IMAGE:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod:${{ github.sha }} + docker tag $CONTAINER_IMAGE:latest $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod:latest + docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod:${{ github.sha }} + docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod:latest - name: Deploy to EKS (DEV) # uses: steebchen/kubectl@v2.0.0 @@ -169,7 +169,7 @@ jobs: if: github.ref == 'refs/heads/main' run: | # defaults to latest kubectl binary version kubectl apply -f desci-repo/kubernetes/deployment.yaml - kubectl set image deployment/desci-repo-server desci-repo-server=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE:${{ github.sha }} --record + kubectl set image deployment/desci-repo-server-prod desci-repo-server-prod=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$CONTAINER_IMAGE-prod:${{ github.sha }} --record - name: Verify EKS Deployment (DEV) if: github.ref == 'refs/heads/develop' @@ -184,4 +184,4 @@ jobs: - name: Verify EKS Deployment (PROD) if: github.ref == 'refs/heads/main' run: | - kubectl rollout status deployment/desci-repo-server + kubectl rollout status deployment/desci-repo-server-prod diff --git a/desci-repo/kubernetes/deployment.yaml b/desci-repo/kubernetes/deployment.yaml index 2df2dadb0..c32479729 100755 --- a/desci-repo/kubernetes/deployment.yaml +++ b/desci-repo/kubernetes/deployment.yaml @@ -20,7 +20,7 @@ spec: apiVersion: apps/v1 kind: Deployment metadata: - name: desci-repo-server + name: desci-repo-server-prod labels: App: DesciRepoServerProd spec: @@ -55,8 +55,8 @@ spec: App: DesciRepoServerProd spec: containers: - - image: 523044037273.dkr.ecr.us-east-2.amazonaws.com/desci-repo-server:latest - name: desci-repo-server + - image: 523044037273.dkr.ecr.us-east-2.amazonaws.com/desci-repo-server-prod:latest + name: desci-repo-server-prod command: ['/bin/bash', '-c'] args: - echo "SOURCING ENV"; source /vault/secrets/config; NODE_PATH=./dist node ./dist/index.js;