Skip to content

Commit 232b362

Browse files
committed
refactor: clean up deployment workflow by removing unnecessary comments and improving script readability
1 parent e73f036 commit 232b362

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ jobs:
7373
exit 1
7474
}
7575
76-
# Ensure user-tracking-service build completes successfully
7776
echo "Building user-tracking-service specifically..."
7877
cd user-tracking-service && mvn -B package -DskipTests && cd ..
7978
@@ -87,7 +86,7 @@ jobs:
8786
if [ -z "$JAR_PATH" ]; then
8887
echo "Error: JAR not found for $service"
8988
exit 1
90-
}
89+
fi
9190
echo "$service build successful: $JAR_PATH"
9291
done
9392
@@ -185,31 +184,23 @@ jobs:
185184
echo "$SSH_KEY" > ssh_key.pem
186185
chmod 600 ssh_key.pem
187186
188-
# Create directory structure on VM
189187
ssh -o StrictHostKeyChecking=no -i ssh_key.pem opc@${ORACLE_VM_IP} "mkdir -p ~/music-analytics/vm-deploy"
190188
191-
# Copy Docker Compose file to VM
192189
scp -o StrictHostKeyChecking=no -i ssh_key.pem cloud-deploy/docker-compose.direct.yml opc@${ORACLE_VM_IP}:~/music-analytics/vm-deploy/docker-compose.yml
193190
194-
# Deploy Docker services with correct environment variables and proper startup sequence
195191
ssh -o StrictHostKeyChecking=no -i ssh_key.pem opc@${ORACLE_VM_IP} "cd ~/music-analytics/vm-deploy && \
196192
docker login ${DOCKER_REGISTRY} -u ${OCI_USERNAME} -p ${OCI_AUTH_TOKEN} && \
197193
export ORACLE_EXTERNAL_HOSTNAME=music-analytics.abenezeranglo.uk && \
198194
export EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://eureka-server:8761/eureka/ && \
199195
export DOCKER_REGISTRY=${DOCKER_REGISTRY} && \
200-
# Stop and remove existing containers in reverse order
201196
docker-compose down --remove-orphans && \
202-
# Remove old containers and unused images
203197
docker container prune -f && \
204198
docker image prune -f && \
205-
# Pull latest images
206199
docker-compose pull && \
207-
# Start services with proper dependency handling
208200
docker-compose up -d eureka-server && \
209201
echo 'Waiting for Eureka server to be healthy...' && \
210202
timeout 300 bash -c 'until docker-compose ps eureka-server | grep -q "(healthy)"; do sleep 5; done' && \
211203
docker-compose up -d api-gateway recommendation-service statistics-service user-tracking-service && \
212-
# Verify all services are running
213204
docker-compose ps && \
214205
docker logout ${DOCKER_REGISTRY}"
215206

0 commit comments

Comments
 (0)