Used Claude to refactor pipeline code

This commit is contained in:
Murtadha 2024-07-19 18:11:56 -04:00
parent eeb659a3a6
commit 7665166847
2 changed files with 26 additions and 13 deletions

View file

@ -49,6 +49,10 @@ pipeline:
script:
- cd /home/mnisyif/docker-containers/mnisyif/frontend
- VERSION=$(cat version.txt)
- echo "Nginx configuration:"
- cat nginx.conf
- echo "Contents of dist directory:"
- ls -la dist
# Stop and remove the existing container if it exists
- docker stop frontend || true
- docker rm frontend || true
@ -62,6 +66,12 @@ pipeline:
- docker ps | grep frontend || echo "Container failed to start"
# Display container logs
- docker logs frontend
# Test Nginx configuration
- docker exec frontend nginx -t
# Check Nginx process
- docker exec frontend ps aux | grep nginx
# Check contents of /usr/share/nginx/html in the container
- docker exec frontend ls -la /usr/share/nginx/html
# Clean up unused containers, images, and volumes
- docker system prune -f --volumes
# Tag the running container with the version

View file

@ -1,16 +1,19 @@
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}
}