Files
Acrybot/.woodpecker.yml
BigGamerGary ffa748f5de
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
A bit of debug
2025-08-13 21:12:10 +10:00

53 lines
2.1 KiB
YAML

kind: pipeline
type: docker # Essential for Docker execution
name: restart-discord-bot
when:
- branch: main
event: push
steps:
# - name: debug-compose-environment # A new step for diagnostics
# image: docker
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# - /home/gary/Discord/Acrybot:/app
# commands:
# - echo "--- Checking environment within pipeline container ---"
# - pwd # Should be /
# - cd /app
# - pwd # Should be /app
# - echo "Contents of /app (your mounted Docker Compose directory):"
# - ls -la # Verify docker-compose.yml is here
# - echo "--- Displaying content of docker-compose.yml (for verification) ---"
# - cat docker-compose.yml # Display the content of the Compose file
# - echo "Docker CLI Version:"
# - docker --version
# - echo "Docker Compose CLI Version:"
# - docker compose version
# - echo "--- Listing Docker Compose services (running and stopped) in this project context ---"
# # This command lists all services (running and stopped) that docker compose finds in /app
# - docker compose ps -a
# # IMPORTANT: If 'docker compose ps -a' shows an empty list or doesn't list your service,
# # it means Docker Compose isn't managing the running bot service from this specific
# # docker-compose.yml file.
# - echo "--- Listing ALL Docker containers on the host (regardless of Compose project) ---"
# - docker ps -a # This lists ALL containers, including those not managed by Compose.
# - echo "--- Attempting to restart the specific bot service ---"
- name: restart-bot
image: docker # Image with Docker Compose
volumes:
# Using the short syntax to reference globally defined named volumes
- /var/run/docker.sock:/var/run/docker.sock # Maps named volume 'docker_sock' to container path
- /home/gary/Discord/Acrybot:/app # Maps named volume 'docker_compose_dir' to container path
commands:
- cd /app
- git config --global --add safe.directory /app
- docker compose down
- docker ps
- git pull
- docker compose up -d
- docker ps