adding docker checks in function file
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
set -e
|
||||
ROOT="${ROOT:-$PWD}"
|
||||
DOCKER_IMAGE="${DOCKER_IMAGE:-sabayon/builder-amd64}"
|
||||
. /sbin/sabayondevkit-functions.sh
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
@@ -9,8 +10,6 @@ if [ $# -eq 0 ]
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "!! If you are not running the script as root, your user should be in the docker group to use it. (sudo gpasswd -a $USER docker) !!"
|
||||
fi
|
||||
check_docker_requirements
|
||||
|
||||
docker run --rm -v "$ROOT"/portage_artifacts:/usr/portage/packages -ti $DOCKER_IMAGE $@
|
||||
|
||||
+3
-3
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
. /sbin/sabayondevkit-functions.sh
|
||||
|
||||
ROOT="${ROOT:-$PWD}"
|
||||
entropysrv=$(mktemp)
|
||||
createrepo=$(mktemp)
|
||||
@@ -8,9 +10,7 @@ REPOSITORY_DESCRIPTION="${REPOSITORY_DESCRIPTION:-My Sabayon repository}"
|
||||
DOCKER_IMAGE="${DOCKER_IMAGE:-sabayon/builder-amd64}"
|
||||
EDITOR=cat
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "!! If you are not running the script as root, your user should be in the docker group to use it. (sudo gpasswd -a $USER docker) !!"
|
||||
fi
|
||||
check_docker_requirements
|
||||
|
||||
echo "Repository: $REPOSITORY_NAME"
|
||||
echo "Repository Description: $REPOSITORY_DESCRIPTION"
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
check_docker_requirements(){
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
groups | grep -q docker || echo "--> If you are not running the script as root, your user should be in the docker group to use it. (sudo gpasswd -a $USER docker)"
|
||||
fi
|
||||
ps aux | grep -q '[d]ocker' || echo "--> Be sure to have the docker daemon running (sudo systemctl start docker)"
|
||||
}
|
||||
|
||||
build() {
|
||||
local SEARCH=$1
|
||||
local EMERGE_DEFAULT_ARGS=${2:---accept-properties=-interactive --verbose --oneshot --nospinner --quiet-build=y --quiet-fail --fail-clean=y --complete-graph --buildpkg}
|
||||
|
||||
Reference in New Issue
Block a user