From 58f01ad6ef5cbfb60c7b867c48ba4f49a201a363 Mon Sep 17 00:00:00 2001 From: Georg Date: Thu, 12 Aug 2021 21:37:51 +0200 Subject: Init Signed-off-by: Georg --- Drone/drone-runner-exec/config | 13 +++++++++++ Drone/drone-runner-exec/drone-runner-exec.service | 14 ++++++++++++ Drone/drone-runner-ssh/run-docker-runner-ssh.sh | 16 +++++++++++++ Drone/run-docker-server.sh | 28 +++++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 Drone/drone-runner-exec/config create mode 100644 Drone/drone-runner-exec/drone-runner-exec.service create mode 100644 Drone/drone-runner-ssh/run-docker-runner-ssh.sh create mode 100644 Drone/run-docker-server.sh diff --git a/Drone/drone-runner-exec/config b/Drone/drone-runner-exec/config new file mode 100644 index 0000000..e352c93 --- /dev/null +++ b/Drone/drone-runner-exec/config @@ -0,0 +1,13 @@ +DRONE_RUNNER_NAME=$RUNNERHOST +DRONE_HTTP_BIND=127.0.0.3:3000 +DRONE_RPC_PROTO=https +DRONE_RPC_HOST=$RUNNERINTRANET +DRONE_RPC_SECRET=$RPCSEC +DRONE_UI_USERNAME=$RUNNERUSER +DRONE_UI_PASSWORD=$RUNNERPASS +DRONE_UI_REALM=DroneRealm +DRONE_LOG_FILE=/var/log/drone-runner-exec/log.txt +DRONE_LOG_FILE_MAX_SIZE=10 +DRONE_LOG_FILE_MAX_AGE=30 +DRONE_LOG_FILE_MAX_BACKUPS=7 +DRONE_DEBUG=true diff --git a/Drone/drone-runner-exec/drone-runner-exec.service b/Drone/drone-runner-exec/drone-runner-exec.service new file mode 100644 index 0000000..8c8607f --- /dev/null +++ b/Drone/drone-runner-exec/drone-runner-exec.service @@ -0,0 +1,14 @@ +[Unit] +Description=Drone Exec Runner + +[Service] +User=drone +Group=drone +StartLimitInterval=5 +StartLimitBurst=10 +ExecStart=/opt/drone/bin/drone-runner-exec "service" "run" "--config" "/opt/drone/.drone-runner-exec/config" +Restart=always +RestartSec=120 + +[Install] +WantedBy=multi-user.target diff --git a/Drone/drone-runner-ssh/run-docker-runner-ssh.sh b/Drone/drone-runner-ssh/run-docker-runner-ssh.sh new file mode 100644 index 0000000..ee41f4f --- /dev/null +++ b/Drone/drone-runner-ssh/run-docker-runner-ssh.sh @@ -0,0 +1,16 @@ +#!/bin/sh +docker run -d \ + -e DRONE_RPC_PROTO=https \ + -e DRONE_RPC_HOST=$RUNNERINTRANET \ + -e DRONE_RPC_SECRET=$RPCSEC \ + -e DRONE_RUNNER_NAME=$RUNNERHOST \ + -e DRONE_UI_PASSWORD=$RUNNERPASS \ + -e DRONE_UI_USERNAME=$RUNNERUSER \ + -e DRONE_UI_REALM=DroneRealm \ + -e DRONE_DEBUG=true \ + -p 127.0.0.3:3001:3000 \ + --dns 192.168.0.115 \ + --restart always \ + --name runner \ + -v /opt/drone/runner_data:/data \ + drone/drone-runner-ssh diff --git a/Drone/run-docker-server.sh b/Drone/run-docker-server.sh new file mode 100644 index 0000000..7b8172e --- /dev/null +++ b/Drone/run-docker-server.sh @@ -0,0 +1,28 @@ +#!/bin/sh +docker run \ + --volume=/opt/drone/data:/data \ + --volume=$CERT:$CERT \ + --volume=$KEY:$KEY \ + --env=DRONE_GITEA_SERVER=https://git.com.de \ + --env=DRONE_GITEA_CLIENT_ID=$GITEAID \ + --env=DRONE_GITEA_CLIENT_SECRET=$GITEASEC \ + --env=DRONE_RPC_SECRET=$RPCSEC \ + --env=DRONE_SERVER_HOST=$DRONEINTRANET \ + --env=DRONE_SERVER_PROTO=https \ + --env=DRONE_DATABASE_DRIVER=postgres \ + --env=DRONE_DATABASE_DATASOURCE=postgres://$DBUSER:$DBPASS@$DBHOST:5432/$DB?sslmode=disable \ + --env=DRONE_DATABASE_SECRET=$DBSEC \ + --env=DRONE_PROMETHEUS_ANONYMOUS_ACCESS=true \ + --env=DRONE_TLS_CERT=$CERT \ + --env=DRONE_TLS_KEY=$KEY \ + --env=DRONE_USER_CREATE=username:drone,admin:true \ + --env=DRONE_DEBUG=true \ + --publish=127.0.0.3:80:80 \ + --publish=127.0.0.3:443:443 \ + --restart=always \ + --detach=true \ + --name=drone \ + drone/drone:2 + +# Disabled: +# --env=DRONE_YAML_ENDPOINT=http://172.17.0.3:3005 \ -- cgit v1.2.3