Used Claude to refactor pipeline code
This commit is contained in:
parent
61ff0b497a
commit
dc4cca6523
1 changed files with 15 additions and 8 deletions
|
|
@ -22,7 +22,7 @@ pipeline:
|
|||
- Dockerfile
|
||||
- nginx.conf
|
||||
- version.txt
|
||||
|
||||
|
||||
webserver-docker-deploy:
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
|
|
@ -40,11 +40,14 @@ pipeline:
|
|||
- ls -la
|
||||
- echo "Dockerfile contents:"
|
||||
- cat Dockerfile
|
||||
- echo "nginx.conf contents:"
|
||||
- cat nginx.conf
|
||||
- echo "Checking dist directory:"
|
||||
- ls -la dist
|
||||
- echo "Building Docker image..."
|
||||
- docker build --no-cache -t frontend:$VERSION . || { echo "Docker build failed"; exit 1; }
|
||||
- echo "Verifying image was created:"
|
||||
- docker images | grep frontend
|
||||
- echo "Docker image built successfully: frontend:$VERSION"
|
||||
- echo "Stopping existing Docker container..."
|
||||
- docker stop frontend || true
|
||||
- echo "Removing existing Docker container..."
|
||||
|
|
@ -52,19 +55,23 @@ pipeline:
|
|||
- echo "Running new Docker container..."
|
||||
- >
|
||||
docker run -d --name frontend -p 5173:80
|
||||
-v /home/mnisyif/docker-containers/mnisyif/frontend/dist:/usr/share/nginx/html
|
||||
-v /home/mnisyif/docker-containers/mnisyif/frontend/nginx.conf:/etc/nginx/nginx.conf
|
||||
-v /home/mnisyif/docker-containers/mnisyif/frontend/dist:/usr/share/nginx/html:ro
|
||||
-v /home/mnisyif/docker-containers/mnisyif/frontend/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
frontend:$VERSION || { echo "Docker run failed"; exit 1; }
|
||||
- echo "Checking container status:"
|
||||
- docker ps -a | grep frontend
|
||||
- echo "Container logs:"
|
||||
- docker logs frontend
|
||||
- echo "Nginx configuration:"
|
||||
- docker exec frontend cat /etc/nginx/nginx.conf
|
||||
- echo "Checking if Nginx is running:"
|
||||
- docker exec frontend ps aux | grep nginx
|
||||
- echo "Nginx error logs:"
|
||||
- docker exec frontend cat /var/log/nginx/error.log
|
||||
- echo "Nginx access logs:"
|
||||
- docker exec frontend cat /var/log/nginx/access.log
|
||||
- echo "Checking mounted volumes:"
|
||||
- docker inspect -f '{{ .Mounts }}' frontend
|
||||
- echo "Checking Nginx configuration:"
|
||||
- docker exec frontend nginx -T
|
||||
- echo "Checking content of /usr/share/nginx/html:"
|
||||
- docker exec frontend ls -la /usr/share/nginx/html
|
||||
- echo "Deployment completed. Container status:"
|
||||
- docker ps | grep frontend || echo "Container is not running"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue