Commit 0c262de1 authored by Florian Hennig's avatar Florian Hennig Committed by Pierre Smeyers
Browse files

feat: allow explicit Burno version to be defined

parent d7f98afb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ It uses the following variable:
| Input / Variable | Description                                                                                                            | Default value                                 |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| `image` / `BRU_IMAGE` | The Docker image used to run the [Bruno CLI](https://docs.usebruno.com/bru-cli/overview).                             | `docker.io/library/node:lts-alpine` <br/>[![Trivy Badge](https://to-be-continuous.gitlab.io/doc/secu/trivy-badge-BRU_IMAGE.svg)](https://to-be-continuous.gitlab.io/doc/secu/trivy-BRU_IMAGE) |
| `version` / `BRU_VERSION` | The version of Bruno to use (leave empty to use latest)                                                          | _none_                        |
| `collections` / `BRU_COLLECTIONS` | The matcher to select Bruno collection directory(ies) to run.                                                          | `bruno`                                       |
| `base-url` / `BRU_BASE_URL` | Explicit base url environment to test.<br/>_Auto-evaluated by default ([see below chapter](#base-url-auto-evaluation))._ | _none_ (auto-evaluated)                             |
| `extra-args` / `BRU_EXTRA_ARGS` | Bruno extra [run options](https://docs.usebruno.com/bru-cli/overview#options)                                         | _none_                                        |
+6 −0
Original line number Diff line number Diff line
@@ -13,6 +13,12 @@
      "description": "The Docker image used to run the [Bruno CLI](https://docs.usebruno.com/cli/overview.html)",
      "default": "docker.io/library/node:lts-alpine"
    },
    {
      "name": "BRU_VERSION",
      "description": "The version of Bruno to use (leave empty to use latest)",
      "type": "text",
      "advanced": true
    },
    {
      "name": "BRU_COLLECTIONS",
      "description": "The matcher to select Bruno collection directory(ies) to run",
+5 −1
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@ spec:
    image:
      description: The Docker image used to run the [Bruno CLI](https://docs.usebruno.com/cli/overview.html)
      default: docker.io/library/node:lts-alpine
    version:
      description: The version of Bruno to use (leave empty to use latest)
      default: ''
    collections:
      description: The matcher to select Bruno collection directory(ies) to run
      default: bruno
@@ -104,6 +107,7 @@ workflow:
variables:
  # Default Docker image (use a public image - can be overridden)
  BRU_IMAGE: $[[ inputs.image ]]
  BRU_VERSION: $[[ inputs.version ]]
  BRU_COLLECTIONS: $[[ inputs.collections ]]
  # default production ref name (pattern)
  PROD_REF: /^(master|main)$/
@@ -424,7 +428,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 ! 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
          if ! npx --yes @usebruno/cli${BRU_VERSION:+@$BRU_VERSION} 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