2020-06-05 21:05:57 +00:00
|
|
|
#!/bin/sh
|
2020-06-05 20:36:50 +00:00
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
random_string() {
|
|
|
|
LC_CTYPE=C tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c32
|
|
|
|
}
|
|
|
|
|
2020-06-05 21:05:57 +00:00
|
|
|
update_env_file () {
|
|
|
|
varname="$1"
|
|
|
|
varvalue="$2"
|
|
|
|
if ! grep -q "$varname" ./.env; then
|
|
|
|
echo "$varname=$varvalue" >> ./.env
|
|
|
|
else
|
|
|
|
sed -i "/$varname/c $varname=$varvalue" ./.env
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
cloudron pull /app/data/.env .env
|
|
|
|
|
|
|
|
. ./.env
|
|
|
|
|
2023-08-02 15:17:01 +00:00
|
|
|
update_env_file DRONE_RPC_HOST "$DRONE_SERVER_HOST"
|
2020-06-05 21:05:57 +00:00
|
|
|
update_env_file DRONE_RUNNER_CAPACITY "$(nproc)"
|
|
|
|
update_env_file DRONE_RUNNER_NAME "$(hostname)"
|
|
|
|
|
2023-08-02 15:17:01 +00:00
|
|
|
docker compose up -d
|