aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-03-31 08:28:43 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-03-31 08:28:38 +0200
commitfafe3a8e38bdb6d12b2654b066b8036ba3e9455d (patch)
treeba443af77fb4185a0facf3276c79e9e6e6ea7f66
parent6b9fedd2211851a70d2d82dea04420e9b87bfff9 (diff)
ci: Remove second user account
-rwxr-xr-xci/test/04_install.sh24
-rwxr-xr-xci/test/05_before_script.sh1
2 files changed, 3 insertions, 22 deletions
diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh
index b4d507cdbb..68526fbf66 100755
--- a/ci/test/04_install.sh
+++ b/ci/test/04_install.sh
@@ -28,11 +28,6 @@ export BINS_SCRATCH_DIR="${BASE_SCRATCH_DIR}/bins/"
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
echo "Creating $CI_IMAGE_NAME_TAG container to run in"
- LOCAL_UID=$(id -u)
- LOCAL_GID=$(id -g)
-
- # the name isn't important, so long as we use the same UID
- LOCAL_USER=nonroot
DOCKER_BUILDKIT=1 ${CI_RETRY_EXE} docker build \
--file "${BASE_ROOT_DIR}/ci/test_imagefile" \
--build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \
@@ -59,18 +54,9 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
--name $CONTAINER_NAME \
$CONTAINER_NAME)
export CI_CONTAINER_ID
- export CI_EXEC_CMD_PREFIX_ROOT="docker exec -u 0 $CI_CONTAINER_ID"
- export CI_EXEC_CMD_PREFIX="docker exec -u $LOCAL_UID $CI_CONTAINER_ID"
- $CI_EXEC_CMD_PREFIX_ROOT rsync --archive --stats --human-readable /ci_base_install/ "${BASE_ROOT_DIR}"
- $CI_EXEC_CMD_PREFIX_ROOT rsync --archive --stats --human-readable /ro_base/ "$BASE_ROOT_DIR"
-
- # Create a non-root user inside the container which matches the local user.
- #
- # This prevents the root user in the container modifying the local file system permissions
- # on the mounted directories
- docker exec "$CI_CONTAINER_ID" useradd -u "$LOCAL_UID" -o -m "$LOCAL_USER"
- docker exec "$CI_CONTAINER_ID" groupmod -o -g "$LOCAL_GID" "$LOCAL_USER"
- docker exec "$CI_CONTAINER_ID" chown -R "$LOCAL_USER":"$LOCAL_USER" "${BASE_ROOT_DIR}"
+ export CI_EXEC_CMD_PREFIX="docker exec ${CI_CONTAINER_ID}"
+ $CI_EXEC_CMD_PREFIX rsync --archive --stats --human-readable /ci_base_install/ "${BASE_ROOT_DIR}"
+ $CI_EXEC_CMD_PREFIX rsync --archive --stats --human-readable /ro_base/ "$BASE_ROOT_DIR"
else
echo "Running on host system without docker wrapper"
"${BASE_ROOT_DIR}/ci/test/01_base_install.sh"
@@ -79,11 +65,7 @@ fi
CI_EXEC () {
$CI_EXEC_CMD_PREFIX bash -c "export PATH=${BINS_SCRATCH_DIR}:\$PATH && cd \"$P_CI_DIR\" && $*"
}
-CI_EXEC_ROOT () {
- $CI_EXEC_CMD_PREFIX_ROOT bash -c "export PATH=${BINS_SCRATCH_DIR}:\$PATH && cd \"$P_CI_DIR\" && $*"
-}
export -f CI_EXEC
-export -f CI_EXEC_ROOT
CI_EXEC mkdir -p "${BINS_SCRATCH_DIR}"
diff --git a/ci/test/05_before_script.sh b/ci/test/05_before_script.sh
index 8e3153a20b..199cdd64a7 100755
--- a/ci/test/05_before_script.sh
+++ b/ci/test/05_before_script.sh
@@ -11,7 +11,6 @@ if [ "$CI_OS_NAME" == "macos" ]; then
echo > "${HOME}/Library/Application Support/Bitcoin"
else
CI_EXEC echo \> \$HOME/.bitcoin
- CI_EXEC_ROOT echo \> \$HOME/.bitcoin
fi
if [ -z "$NO_DEPENDS" ]; then