aboutsummaryrefslogtreecommitdiff
path: root/src/oryx/install.sh
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-06-13 23:30:57 +0300
committerGitHub <noreply@github.com>2022-06-13 23:30:57 +0300
commitfa07406f4dccd482284cb9d8dbaca6533116dab8 (patch)
tree438c8fd7b17b3d69ecede41ea0bdea99fe0e4eea /src/oryx/install.sh
parent19fd66af965b22f57fd59a0ba31136146b9542d1 (diff)
add missing user groups to fix permission issues for non root user (#45)
* add missing user groups * fix username * move chmod: anaconda
Diffstat (limited to 'src/oryx/install.sh')
-rwxr-xr-xsrc/oryx/install.sh17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/oryx/install.sh b/src/oryx/install.sh
index c0e04d2..5eeaf18 100755
--- a/src/oryx/install.sh
+++ b/src/oryx/install.sh
@@ -86,6 +86,11 @@ check_packages git sudo wget ca-certificates
if ! oryx --version > /dev/null ; then
echo "Installing Oryx..."
+ if ! cat /etc/group | grep -e "^oryx:" > /dev/null 2>&1; then
+ groupadd -r oryx
+ fi
+ usermod -a -G oryx "${USERNAME}"
+
# Install dotnet unless available
if ! dotnet --version > /dev/null ; then
echo "'dotnet' was not detected. Attempting to install the latest version of the dotnet sdk to build oryx."
@@ -104,7 +109,6 @@ if ! oryx --version > /dev/null ; then
mkdir -p ${BUILD_SCRIPT_GENERATOR}
mkdir -p ${ORYX}
- chown -R ${USERNAME} ${BUILD_SCRIPT_GENERATOR} ${ORYX}
git clone --depth=1 https://github.com/microsoft/Oryx $GIT_ORYX
$GIT_ORYX/build/buildSln.sh
@@ -118,11 +122,16 @@ if ! oryx --version > /dev/null ; then
ln -s ${BUILD_SCRIPT_GENERATOR}/GenerateBuildScript ${ORYX}/oryx
cp -f $GIT_ORYX/images/build/benv.sh ${ORYX}/benv
- ORYX_INSTALL_DIR="/tmp/oryx-platforms"
+ ORYX_INSTALL_DIR="/usr/local/oryx-platforms"
mkdir -p "${ORYX_INSTALL_DIR}"
- chown -R ${USERNAME} "${ORYX_INSTALL_DIR}"
- updaterc "export ORYX_SDK_STORAGE_BASE_URL=https://oryx-cdn.microsoft.io && export ENABLE_DYNAMIC_INSTALL=true && DYNAMIC_INSTALL_ROOT_DIR=$ORYX_INSTALL_DIR"
+ updaterc "export ORYX_SDK_STORAGE_BASE_URL=https://oryx-cdn.microsoft.io && export ENABLE_DYNAMIC_INSTALL=true && DYNAMIC_INSTALL_ROOT_DIR=$ORYX_INSTALL_DIR && ORYX_PREFER_USER_INSTALLED_SDKS=true"
+
+ chown -R :oryx "${ORYX_INSTALL_DIR}" "${BUILD_SCRIPT_GENERATOR}" "${ORYX}"
+ chmod -R g+r+w "${ORYX_INSTALL_DIR}" "${BUILD_SCRIPT_GENERATOR}" "${ORYX}"
+ find "${ORYX_INSTALL_DIR}" -type d | xargs -n 1 chmod g+s
+ find "${BUILD_SCRIPT_GENERATOR}" -type d | xargs -n 1 chmod g+s
+ find "${ORYX}" -type d | xargs -n 1 chmod g+s
fi
echo "Done!"