This commit is contained in:
2023-07-26 12:48:42 +02:00
parent e715cdf9af
commit 4a2e811efc
14 changed files with 715 additions and 194 deletions

View File

@@ -4,12 +4,12 @@ kind: Secret
metadata:
name: gitea-init
labels:
helm.sh/chart: gitea-9.0.4
helm.sh/chart: gitea-8.0.3
app: gitea
app.kubernetes.io/name: gitea
app.kubernetes.io/instance: gitea
app.kubernetes.io/version: "1.20.1"
version: "1.20.1"
app.kubernetes.io/version: "1.19.1"
version: "1.19.1"
app.kubernetes.io/managed-by: Helm
type: Opaque
stringData:
@@ -24,12 +24,14 @@ stringData:
set -euo pipefail
set -x
chown 1000:1000 /data
mkdir -p /data/git/.ssh
chmod -R 700 /data/git/.ssh
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
# prepare temp directory structure
mkdir -p "${GITEA_TEMP}"
chown 1000:1000 "${GITEA_TEMP}"
chmod ug+rwx "${GITEA_TEMP}"
@@ -47,24 +49,6 @@ stringData:
echo "Gitea migrate might fail due to database connection...This init-container will try again in a few seconds"
exit 1
}
function test_redis_connection() {
local RETRY=0
local MAX=30
echo 'Wait for redis to become avialable...'
until [ "${RETRY}" -ge "${MAX}" ]; do
nc -vz -w2 gitea-redis-cluster-headless.vynil-ci.svc.cluster.local 6379 && break
RETRY=$[${RETRY}+1]
echo "...not ready yet (${RETRY}/${MAX})"
done
if [ "${RETRY}" -ge "${MAX}" ]; then
echo "Redis not reachable after '${MAX}' attempts!"
exit 1
fi
}
test_redis_connection
function configure_admin_user() {
local ACCOUNT_ID=$(gitea admin user list --admin | grep -e "\s\+${GITEA_ADMIN_USERNAME}\s\+" | awk -F " " "{printf \$1}")
if [[ -z "${ACCOUNT_ID}" ]]; then