Skip to content

Commit

Permalink
Merge branch 'main' into feature/dev-ci-1
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinebrasil authored Dec 8, 2024
2 parents b2b27c3 + ebbb089 commit d705a13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,19 @@ jobs:
run: aws eks --region $AWS_REGION update-kubeconfig --name $EKS_CLUSTER_NAME

- name: Deploy to EKS cluster in development namespace
env:
IMAGE_VERSION: ${{ env.image-version }}
run: |
source $GITHUB_ENV
ENVIRONMENT=development
KUSTOMIZE_DIR=$(pwd)/infra/kubernetes/$ENVIRONMENT
cd $KUSTOMIZE_DIR
# Check if namespace exists, if not create it
kubectl get namespace $ENVIRONMENT || kubectl create namespace $ENVIRONMENT
kustomize edit set image web=$ECR_REGISTRY/$ECR_REPOSITORY:${{ env.IMAGE_VERSION }}
kustomize edit set image web=$ECR_REGISTRY/$ECR_REPOSITORY:${{ env.image-version }}
echo "Deploying resource in $ENVIRONMENT namespace."
cd $KUSTOMIZE_DIR
echo "Using image version: $IMAGE_VERSION"
echo "Using image version: ${{ env.image-version }}"
kubectl apply -k $KUSTOMIZE_DIR -n $ENVIRONMENT && echo "Resources deployed successfully!" || {echo "Failed to deploy resources! Check the logs"; kubectl describe pods -n $ENVIRONMENT; exit 1; }
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
ENVIRONMENT=production
KUSTOMIZE_DIR=$(pwd)/infra/kubernetes/production
cd $KUSTOMIZE_DIR
# Check if namespace exists, if not create it
kubectl get namespace $ENVIRONMENT || kubectl create namespace $ENVIRONMENT
Expand All @@ -112,7 +113,6 @@ jobs:
kustomize edit set image web=$ECR_REGISTRY/$ECR_REPOSITORY:${{ env.NEW_VERSION }}
echo "Deploying resources in $ENVIRONMENT environment"
cd $KUSTOMIZE_DIR
echo "Using image version: ${{ env.NEW_VERSION }}"
kubectl apply -k $KUSTOMIZE_DIR -n $ENVIRONMENT && echo "Resources deployed successfully!" || {echo "Failed to deploy resources! Check the logs"; kubectl describe pods -n $ENVIRONMENT; exit 1; }

0 comments on commit d705a13

Please sign in to comment.