Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99b8126b59 | ||
|
|
b472581622 |
+28
-3
@@ -4,7 +4,7 @@ set -Eeuo pipefail
|
|||||||
|
|
||||||
GITEA_URL="${GITEA_URL:-http://38.76.196.225:10099/}"
|
GITEA_URL="${GITEA_URL:-http://38.76.196.225:10099/}"
|
||||||
GITEA_REPOSITORY="${GITEA_REPOSITORY:-awaioi/ERP}"
|
GITEA_REPOSITORY="${GITEA_REPOSITORY:-awaioi/ERP}"
|
||||||
RUNNER_IMAGE="${RUNNER_IMAGE:-gitea/runner:3.0.2}"
|
RUNNER_IMAGE="${RUNNER_IMAGE:-}"
|
||||||
RUNNER_CONTAINER="${RUNNER_CONTAINER:-gitea-runner}"
|
RUNNER_CONTAINER="${RUNNER_CONTAINER:-gitea-runner}"
|
||||||
RUNNER_VOLUME="${RUNNER_VOLUME:-gitea-runner-data}"
|
RUNNER_VOLUME="${RUNNER_VOLUME:-gitea-runner-data}"
|
||||||
RUNNER_LABELS="${RUNNER_LABELS:-ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest}"
|
RUNNER_LABELS="${RUNNER_LABELS:-ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest}"
|
||||||
@@ -46,6 +46,32 @@ find_gitea_container() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pull_runner_image() {
|
||||||
|
local candidate
|
||||||
|
local -a candidates
|
||||||
|
|
||||||
|
if [[ -n "$RUNNER_IMAGE" ]]; then
|
||||||
|
candidates=("$RUNNER_IMAGE")
|
||||||
|
else
|
||||||
|
candidates=(
|
||||||
|
"docker.gitea.com/runner:3.0.2"
|
||||||
|
"docker.gitea.com/act_runner:3.0.2"
|
||||||
|
"gitea/runner:3.0.2"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
|
||||||
|
for candidate in "${candidates[@]}"; do
|
||||||
|
log "Pulling $candidate"
|
||||||
|
if docker pull "$candidate"; then
|
||||||
|
RUNNER_IMAGE="$candidate"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
log "Image source failed; trying the next source"
|
||||||
|
done
|
||||||
|
|
||||||
|
fail "all official Gitea Runner image sources failed"
|
||||||
|
}
|
||||||
|
|
||||||
GITEA_CONTAINER="$(find_gitea_container || true)"
|
GITEA_CONTAINER="$(find_gitea_container || true)"
|
||||||
[[ -n "$GITEA_CONTAINER" ]] || fail "no running Gitea container was found"
|
[[ -n "$GITEA_CONTAINER" ]] || fail "no running Gitea container was found"
|
||||||
|
|
||||||
@@ -72,8 +98,7 @@ fi
|
|||||||
[[ -s "$TOKEN_FILE" ]] || fail "Gitea returned an empty runner token"
|
[[ -s "$TOKEN_FILE" ]] || fail "Gitea returned an empty runner token"
|
||||||
chmod 600 "$TOKEN_FILE"
|
chmod 600 "$TOKEN_FILE"
|
||||||
|
|
||||||
log "Pulling $RUNNER_IMAGE"
|
pull_runner_image
|
||||||
docker pull "$RUNNER_IMAGE"
|
|
||||||
docker rm -f "$RUNNER_CONTAINER" >/dev/null 2>&1 || true
|
docker rm -f "$RUNNER_CONTAINER" >/dev/null 2>&1 || true
|
||||||
docker volume create "$RUNNER_VOLUME" >/dev/null
|
docker volume create "$RUNNER_VOLUME" >/dev/null
|
||||||
docker run --rm --entrypoint /bin/rm \
|
docker run --rm --entrypoint /bin/rm \
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ PY
|
|||||||
NO_SERVICE=0
|
NO_SERVICE=0
|
||||||
PUBLIC_KEY="$(<"$tmp/public.pem")"
|
PUBLIC_KEY="$(<"$tmp/public.pem")"
|
||||||
|
|
||||||
detect_platform() { PLATFORM=darwin; }
|
detect_platform() { PLATFORM=darwin; ARCH=amd64; }
|
||||||
check_and_install_dependencies() { JAVA_BIN="$(command -v java)"; return 0; }
|
check_and_install_dependencies() { JAVA_BIN="$(command -v java)"; return 0; }
|
||||||
start_service() { return 0; }
|
start_service() { return 0; }
|
||||||
wait_for_installer() { return 0; }
|
wait_for_installer() { return 0; }
|
||||||
@@ -323,7 +323,7 @@ PY
|
|||||||
[[ -r "$INSTALL_ROOT/current/app/kaidi-erp.jar" ]] || return 1
|
[[ -r "$INSTALL_ROOT/current/app/kaidi-erp.jar" ]] || return 1
|
||||||
(
|
(
|
||||||
source "$ERP_CONFIG_ROOT/erp.env"
|
source "$ERP_CONFIG_ROOT/erp.env"
|
||||||
[[ "$SPRING_PROFILES_ACTIVE" == "postgres" ]]
|
[[ -z "${SPRING_PROFILES_ACTIVE:-}" ]]
|
||||||
[[ "$OA_UPDATE_ENABLED" == "true" ]]
|
[[ "$OA_UPDATE_ENABLED" == "true" ]]
|
||||||
[[ "$OA_UPDATE_GITEA_BASE_URL" == "http://127.0.0.1:$port" ]]
|
[[ "$OA_UPDATE_GITEA_BASE_URL" == "http://127.0.0.1:$port" ]]
|
||||||
[[ "$ERP_SETUP_TOKEN" =~ ^[0-9a-f]{64}$ ]]
|
[[ "$ERP_SETUP_TOKEN" =~ ^[0-9a-f]{64}$ ]]
|
||||||
@@ -528,6 +528,7 @@ test_installer_requires_explicit_gitea_url() (
|
|||||||
set --
|
set --
|
||||||
source "$root/install.sh"
|
source "$root/install.sh"
|
||||||
GITEA_BASE_URL=
|
GITEA_BASE_URL=
|
||||||
|
NO_SERVICE=1
|
||||||
main
|
main
|
||||||
' _ "$PROJECT_ROOT" 2>&1)" || status=$?
|
' _ "$PROJECT_ROOT" 2>&1)" || status=$?
|
||||||
[[ "$status" -ne 0 && "$output" == *'Gitea URL is required'* ]]
|
[[ "$status" -ne 0 && "$output" == *'Gitea URL is required'* ]]
|
||||||
|
|||||||
Reference in New Issue
Block a user