shore: test the pipelines to see if they work

This commit is contained in:
Favee 2025-05-13 02:14:25 +01:00
parent a0e923ec35
commit 04e9c9caa7

View file

@ -123,25 +123,25 @@
run: | run: |
CLUSTER_NAME="petclinic-${{ env.ENV_NAME }}" CLUSTER_NAME="petclinic-${{ env.ENV_NAME }}"
SERVICE_NAME="petclinic-service" SERVICE_NAME="petclinic-service"
# Check if cluster exists # Check if cluster exists
if ! aws ecs describe-clusters --clusters $CLUSTER_NAME | grep -q "ACTIVE"; then if ! aws ecs describe-clusters --clusters $CLUSTER_NAME | grep -q "ACTIVE"; then
echo "Error: ECS cluster $CLUSTER_NAME doesn't exist or isn't active" echo "Error: ECS cluster $CLUSTER_NAME doesn't exist or isn't active"
aws ecs create-cluster --cluster-name $CLUSTER_NAME aws ecs create-cluster --cluster-name $CLUSTER_NAME
echo "DEPLOYMENT_NEEDED=false" >> $GITHUB_ENV echo "DEPLOYMENT_NEEDED=false" >> $GITHUB_ENV
else else
# Check if service exists
# Check if service exists if ! aws ecs list-services --cluster $CLUSTER_NAME | grep -q $SERVICE_NAME; then
if ! aws ecs list-services --cluster $CLUSTER_NAME | grep -q $SERVICE_NAME; then echo "Service $SERVICE_NAME doesn't exist in cluster $CLUSTER_NAME, creating it..."
echo "Service $SERVICE_NAME doesn't exist in cluster $CLUSTER_NAME, creating it..."
# Here you would add code to create the service echo "For now, skipping deployment as service doesn't exist yet"
# This would require task definition setup as well echo "DEPLOYMENT_NEEDED=false" >> $GITHUB_ENV
echo "For now, skipping deployment as service doesn't exist yet" else
echo "DEPLOYMENT_NEEDED=false" >> $GITHUB_ENV echo "Service exists, proceeding with deployment"
else echo "DEPLOYMENT_NEEDED=true" >> $GITHUB_ENV
echo "Service exists, proceeding with deployment" fi
echo "DEPLOYMENT_NEEDED=true" >> $GITHUB_ENV
fi fi
- name: Deploy to ECS - name: Deploy to ECS
if: env.DEPLOYMENT_NEEDED == 'true' if: env.DEPLOYMENT_NEEDED == 'true'