Handle docker.sock permission errors in Jenkins CI
This commit is contained in:
parent
a644d2df3d
commit
292a0026ed
1 changed files with 17 additions and 2 deletions
|
|
@ -29,9 +29,24 @@ fi
|
||||||
.ci-bin/docker version
|
.ci-bin/docker version
|
||||||
.ci-bin/docker-compose version
|
.ci-bin/docker-compose version
|
||||||
|
|
||||||
|
DOCKER=./.ci-bin/docker
|
||||||
|
COMPOSE=./.ci-bin/docker-compose
|
||||||
|
if ! $DOCKER version >/dev/null 2>&1; then
|
||||||
|
if command -v sudo >/dev/null 2>&1 && sudo -n $DOCKER version >/dev/null 2>&1; then
|
||||||
|
DOCKER="sudo $DOCKER"
|
||||||
|
COMPOSE="sudo $COMPOSE"
|
||||||
|
else
|
||||||
|
echo "ERROR: Jenkins cannot access /var/run/docker.sock (permission denied)."
|
||||||
|
echo "Fix in Coolify: jenkins service needs user 0:0 or group_add matching host docker GID."
|
||||||
|
ls -la /var/run/docker.sock 2>/dev/null || true
|
||||||
|
id
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
sed '/exclude_from_hc:/d' docker-compose.yml > dist/docker-compose.coolify.yml
|
sed '/exclude_from_hc:/d' docker-compose.yml > dist/docker-compose.coolify.yml
|
||||||
.ci-bin/docker-compose -f dist/docker-compose.coolify.yml config -q
|
$COMPOSE -f dist/docker-compose.coolify.yml config -q
|
||||||
|
|
||||||
VERSION="$(grep -E '^ERPNEXT_VERSION=' example.env | cut -d= -f2)"
|
VERSION="$(grep -E '^ERPNEXT_VERSION=' example.env | cut -d= -f2)"
|
||||||
.ci-bin/docker pull "frappe/erpnext:${VERSION}"
|
$DOCKER pull "frappe/erpnext:${VERSION}"
|
||||||
echo "frappe/erpnext:${VERSION} OK"
|
echo "frappe/erpnext:${VERSION} OK"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue