Commit 2e305df1 authored by Florian Hennig's avatar Florian Hennig Committed by Pierre Smeyers
Browse files

feat: prevent a global Bruno installation

In order to support rootless images, Bruno is no longer installed globally, but used through `npx`
parent 25dea097
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -384,16 +384,6 @@ stages:
    fi
  }

  function maybe_install_bruno() {
    if ! command -v bru > /dev/null
    then
      log_info "Installing Bruno..."
      npm install -g @usebruno/cli
    else
      log_info "Bruno command detected: skip install"
    fi
  }

  unscope_variables
  eval_all_secrets

@@ -420,7 +410,6 @@ bruno:
    - !reference [.bru-scripts]
    - install_ca_certs "${CUSTOM_CA_CERTS:-$DEFAULT_CA_CERTS}"
    - eval_env_url
    - maybe_install_bruno
  script:
    - mkdir -p -m 777 reports
    # maybe execute pre hook
@@ -435,7 +424,7 @@ bruno:
          log_info "Running collection \\e[33;1m./${collection}\\e[0m..."
          namenopunct=$(basename $collection | tr '[:punct:]' '_')
          junit_report="$CI_PROJECT_DIR/reports/bruno-$namenopunct.xunit.xml"
          if ! bru run -r --output "$junit_report" --format junit $cacerts_opt ${BRU_BASE_URL:+--env-var "base_url=$BRU_BASE_URL"} $BRU_EXTRA_ARGS
          if ! npx --yes @usebruno/cli run -r --output "$junit_report" --format junit $cacerts_opt ${BRU_BASE_URL:+--env-var "base_url=$BRU_BASE_URL"} $BRU_EXTRA_ARGS
          then
            log_error "Collection \\e[33;1m./${collection}\\e[0m failed"
            rc=127