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
image: ubuntu
commands:
- echo "Running tests"
- uname -a
- echo "Test complete"
- echo "Spuštění Woodpecker agenta"
- ./start_woodpecker_agent.sh
- echo "Aktualizace a instalace Dockeru"
- ./ubuntu_docker.sh
when:
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."