Combine Docker setup and Woodpecker agent start in one step

This commit is contained in:
archos 2024-05-24 16:14:28 +02:00
parent 27331627cc
commit 63b86aa9c5
2 changed files with 21 additions and 3 deletions

View File

@ -2,9 +2,9 @@ steps:
- name: test - name: test
image: ubuntu image: ubuntu
commands: commands:
- echo "Running tests" - echo "Spuštění Woodpecker agenta"
- uname -a - ./start_woodpecker_agent.sh
- echo "Test complete" - echo "Aktualizace a instalace Dockeru"
- ./ubuntu_docker.sh - ./ubuntu_docker.sh
when: when:
branch: branch:

18
start_woodpecker_agent.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
# Získání Woodpecker Agent Secret
read -p "Zadejte WOODPECKER_AGENT_SECRET: " WOODPECKER_AGENT_SECRET
# Spuštění Woodpecker agenta
echo "Spuštění Woodpecker agenta..."
docker run --name=woodpecker-agent --restart=always --detach \
-e WOODPECKER_SERVER="http://woodpecker.arch-linux.cz:9000" \
-e WOODPECKER_MAX_WORKFLOWS=4 \
-e WOODPECKER_GRPC_SECURE=true \
-e WOODPECKER_LOG_LEVEL=info \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WOODPECKER_BACKEND=docker \
-e WOODPECKER_AGENT_SECRET="$WOODPECKER_AGENT_SECRET" \
woodpeckerci/woodpecker-agent:latest
echo "Spuštění Woodpecker agenta je dokončeno."