From b71f4cb5259e0ae8b658065eac90381ad578ec20 Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sun, 21 Jan 2024 17:32:14 +0400 Subject: [PATCH] Unify access to env variables (#2086) --- .github/workflows/contributed-recipes.yml | 2 +- aarch64-runner/setup.sh | 2 +- docs/using/recipe_code/oracledb.dockerfile | 2 +- images/docker-stacks-foundation/start.sh | 2 +- tests/docker-stacks-foundation/test_user_options.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/contributed-recipes.yml b/.github/workflows/contributed-recipes.yml index 77d84e0445..100ed11c99 100644 --- a/.github/workflows/contributed-recipes.yml +++ b/.github/workflows/contributed-recipes.yml @@ -30,7 +30,7 @@ jobs: - name: Calculate recipes matrix 🛠 id: set-matrix - run: docs/using/recipe_code/generate_matrix.py >> $GITHUB_OUTPUT + run: docs/using/recipe_code/generate_matrix.py >> "${GITHUB_OUTPUT}" test-recipes: runs-on: ${{ matrix.runs-on }} diff --git a/aarch64-runner/setup.sh b/aarch64-runner/setup.sh index 9a84bf7156..fb6e05b176 100755 --- a/aarch64-runner/setup.sh +++ b/aarch64-runner/setup.sh @@ -3,7 +3,7 @@ set -ex GITHUB_RUNNER_USER="runner-user" -if [ "$EUID" -ne 0 ]; then +if [ "${EUID}" -ne 0 ]; then echo "Please run as root" exit 1 fi diff --git a/docs/using/recipe_code/oracledb.dockerfile b/docs/using/recipe_code/oracledb.dockerfile index d0daa90123..85564d0a24 100644 --- a/docs/using/recipe_code/oracledb.dockerfile +++ b/docs/using/recipe_code/oracledb.dockerfile @@ -33,7 +33,7 @@ RUN wget --progress=dot:giga "${INSTANTCLIENT_URL}/oracle-instantclient-basiclit # And configure variables RUN echo "ORACLE_HOME=/usr/lib/oracle/${INSTANTCLIENT_MAJOR_VERSION}/client64" >> "${HOME}/.bashrc" && \ - echo "PATH=${ORACLE_HOME}/bin:$PATH" >> "${HOME}/.bashrc" && \ + echo "PATH=${ORACLE_HOME}/bin:${PATH}" >> "${HOME}/.bashrc" && \ echo "LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}" >> "${HOME}/.bashrc" && \ echo "export ORACLE_HOME" >> "${HOME}/.bashrc" && \ echo "export PATH" >> "${HOME}/.bashrc" && \ diff --git a/images/docker-stacks-foundation/start.sh b/images/docker-stacks-foundation/start.sh index 7d354b887c..f2108258e6 100755 --- a/images/docker-stacks-foundation/start.sh +++ b/images/docker-stacks-foundation/start.sh @@ -133,7 +133,7 @@ if [ "$(id -u)" == 0 ]; then sed -r "s#Defaults\s+secure_path\s*=\s*\"?([^\"]+)\"?#Defaults secure_path=\"${CONDA_DIR}/bin:\1\"#" /etc/sudoers | grep secure_path > /etc/sudoers.d/path # Optionally grant passwordless sudo rights for the desired user - if [[ "$GRANT_SUDO" == "1" || "$GRANT_SUDO" == "yes" ]]; then + if [[ "${GRANT_SUDO}" == "1" || "${GRANT_SUDO}" == "yes" ]]; then _log "Granting ${NB_USER} passwordless sudo rights!" echo "${NB_USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/added-by-start-script fi diff --git a/tests/docker-stacks-foundation/test_user_options.py b/tests/docker-stacks-foundation/test_user_options.py index cc8a1b837b..7463539b9d 100644 --- a/tests/docker-stacks-foundation/test_user_options.py +++ b/tests/docker-stacks-foundation/test_user_options.py @@ -262,7 +262,7 @@ def test_jupyter_env_vars_to_unset( "start.sh", "bash", "-c", - "echo I like $FRUIT and ${SECRET_FRUIT:-stuff}, and love ${SECRET_ANIMAL:-to keep secrets}!", + "echo I like ${FRUIT} and ${SECRET_FRUIT:-stuff}, and love ${SECRET_ANIMAL:-to keep secrets}!", ], **root_args, # type: ignore )