Bash Reference

FlowCov provides you with detailed configuration options to control how to upload your reports. On this page, you will find all options available.

Reference

You can always see this reference by opening a shell and executing this command:
bash <(curl -s https://bash.flowcov.io) --help

$ bash <(curl -s https://bash.flowcov.io) --help
______ _ _____
| ____| | / ____| v0.3.0
| |__ | | _____ _| | _____ __
| __| | |/ _ \ \ /\ / / | / _ \ \ / /
| | | | (_) \ V V /| |___| (_) \ V /
|_| |_|\___/ \_/\_/ \_____\___/ \_/
FlowCov Bash v0.3.0
Report uploading tool for FlowCov.io
Documentation at https://docs.flowcov.io
Contribute at https://github.com/FlowSquad/flowcov-bash
Required Parameters
If one of these parameters is missing, the upload will fail.
-a KEY The API Key to use.
(or use) --api-key KEY
(or set) FLOWCOV_API_KEY=KEY
-r ID The Repository to use.
(or use) --repository-id ID
(or set) FLOWCOV_REPOSITORY_ID=ID
Build Type
If no build type is specified, auto-detection will be used to determine
any supported CI provider. Setting this flag does not disable auto-detection
for commit information.
-c Use Build Type CI.
(or use) --ci
-l Use Build Type Local.
(or use) --local
(or use) --no-ci [DEPRECATED]
Commit Information
By default, this information will be extracted from the environment
variables set by your CI provider. If that is not possible, git will be
queried for that information. Manual parameters always have precedence.
-ci SHA Override the commit id.
(or use) --commit-id SHA
(or set) FLOWCOV_COMMIT_ID=SHA
-cm MSG Override the commit message.
(or use) --commit-message MSG
(or set) FLOWCOV_COMMIT_MESSAGE=MSG
-ca NAME Override the commit author. Has the format "name <email>".
(or use) --commit-author NAME
(or set) FLOWCOV_COMMIT_AUTHOR=NAME
-b NAME Override the branch name.
(or use) --branch-name NAME
(or set) FLOWCOV_BRANCH_NAME=NAME
-xa Disable auto-detection of commit information.
(or use) --no-auto-detection
(or set) FLOWCOV_NO_AUTO_DETECTION=true
-xg Disable git usage for auto-detection.
(or use) --no-git
(or set) FLOWCOV_NO_GIT=true
Upload Parameters
Use these parameters to change the default behavior of the script. This
is usually only required in certain situations.
-s DIR The directory to search for reports.
(or use) --dir DIR
(or set) FLOWCOV_SEARCH_DIR=DIR
-f Fail the script if the upload fails.
(or use) --fail-on-error
(or set) FLOWCOV_FAIL_ON_ERROR=true
-e Don't upload build if no reports were found.
(or use) --skip-empty-upload
(or set) FLOWCOV_SKIP_EMPTY_UPLOAD=true
-u URL Override the target url for the upload. Required if you're
using a managed or on-premise installation.
(or use) --url URL
(or set) FLOWCOV_URL=URL
Help And Debug Options
Use these parameters to debug your command if it does not behave as expected.
-h Display this help and exit.
(or use) --help
-d Print the upload to console output instead of sending it to
the server.
(or use) --debug
(or set) FLOWCOV_DEBUG=true
-v Output additional log information for debugging.
>> Attention: Argument must be passed as first argument!
(or use) --verbose
(or set) FLOWCOV_VERBOSE=true

Required parameters

The following parameters are required for each run. If one of these is missing, the script execution will fail with an error.


-a <KEY>*

Specifies the API key to authenticate and authorize you. Also available by specifying one of these:

  • --api-key <KEY>
  • FLOWCOV_API_KEY=<KEY>

-r <ID>*

Specifies the ID of the repository to upload the reports into. You need to have at least the Member role to upload builds. Also available by specifying one of these:

  • --repository-id <ID>
  • FLOWCOV_REPOSITORY_ID=<ID>

Build types

If no build type is specified, auto-detection will be used to determine any supported CI provider. Setting one of these flags does not disable auto-detection for commit information.

By default, the script tries to discover if it is ran inside an automated CI pipeline. It currently supports the following vendors:

  • Jenkins
  • Travis CI
  • Codebuild CI
  • CircleCI
  • GitLab CI
  • GitHub Actions

If the detection does not work for your vendor, or you want to specify manually if this is a local or a CI build, you can specify either -c or -l. These flags are mutually exclusive. If both are specified, the last specified will win.


-c

Override the build type as CI build. Also available by specifying one of these:

  • --ci

-l

Override the build type as local build. Also available by specifying one of these:

  • --local
  • --no-ci   [DEPRECATED]

Commit information

Each build contains information about the commit that it was created for. The following information will included:

  • Commit ID
  • Commit Message
  • Commit Author (name and email)
  • Branch Name

By default, this information will be extracted from the environment variables set by your CI provider. The following information is available for the supported CI vendors:

  • Jenkins: Commit ID, Branch name
  • Travis CI: Commit ID, Branch name, Commit message
  • Codebuild CI: Commit ID, Branch name
  • CircleCI: Commit ID, Branch name
  • GitLab CI: Commit ID, Branch name, Commit message
  • GitHub Actions: Commit ID, Branch name

If some information is missing, your CI provider cannot be detected, or you are using a local build, git will instead be queried for that information. For that to work, the git binary must be available on your path.

Information that you specify manually always have precedence over auto-detected information.


-ci <SHA>

This parameter allows you to manually override the commit id that this upload is tagged with. Also available by specifying one of these:

  • --commit-id <SHA>
  • FLOWCOV_COMMIT_ID=<SHA>
important

If you specify the commit id manually, this commit id will also be used to extract the commit message and author from git. This does not apply if the information is extracted from your CI environment, or if you specify the information manually by passing it as parameters.


-cm <MSG>

This parameter allows you to manually override the commit message that this upload is tagged with. Also available by specifying one of these:

  • --commit-message <MSG>
  • FLOWCOV_COMMIT_MESSAGE=<MSG>

-ca <NAME>

This parameter allows you to manually override the commit author that this upload is tagged with. Also available by specifying one of these:

  • --commit-author <NAME>
  • FLOWCOV_COMMIT_AUHTOR=NAME

For the name to be correctly detected in the UI, it should be specified in the format AUTHOR_NAME <AUTHOR_EMAIL>, for example John Doe <j.doe@flowcov.io>.


-b <NAME>

This parameter allows you to manually override the branch name that this upload is tagged with. Also available by specifying one of these:

  • --branch-name <NAME>
  • FLOWCOV_BRANCH_NAME=<NAME>

-xa

This flag disables the auto-detection of commit information for the CI environment and git. You need to specify the information manually or no commmit information will be added to this build. Also available by specifying one of these:

  • --no-auto-detection
  • FLOWCOV_NO_AUTO_DETECTION=true

-xg

This flag disables the auto-detection of commit information for git only. Information from the CI environment will still be used. You can alternatively provide commit information manually. Also available by using one of these:

  • --no-git
  • FLOWCOV_NO_GIT=true

Upload parameters

These parameters allow you to change the default behavior of the script.


-s <DIR>

This parameter allows you to override the location that is recursively searched for reports. By default, the current directory and all subdirectories will be searched. Also available by specifying one of these:

  • --dir <DIR>
  • FLOWCOV_SEARCH_DIR=<DIR>

-f

This parameter forces the script to exit with code 1 if an error occurs. This usually fails your pipeline. The default behavior is to always exit with code 0. Also available by specifying one of these:

  • --fail-on-error
  • FLOWCOV_FAIL_ON_ERROR=true

-e

This parameter forces the script to skip the upload if no reports were found. The default behavior is to always upload the build, even if no reports were found. Also available by specifying one of these:

  • --skip-empty-upload
  • FLOWCOV_SKIP_EMPTY_UPLOAD=true

-u <URL>

This parameter allows you to define the target server for the upload. By default, https://app.flowcov.io/ will be used. This is usually only required if you use testing environments or have an on-premise or dedicated installation of FlowCov. The http(s):// part is required and there must be no slash at the end of the url.


Help and debug options

These parameters help you debug if the script does not behave as you expect.


-h

This parameter prints the help dialog shown at the top of the screen. Also available by specifying one of these:

  • --help

-d

This parameter prints the generated request body to console output instead of sending it to the server. Also available by specifying one of these:

  • --debug
  • FLOWCOV_DEBUG=true

-v

This parameter enables verbose output logging. Additional information is printed to console output and the curl command will be executed in verbose mode as well. Also available by specifying one of these:

  • --verbose
  • FLOWCOV_VERBOSE=true