The official command line utility for Zeus.
The CLI comes as NPM package and can be installed via npm or yarn:
npm install -g @zeus-ci/cli
yarn add -g @zeus-ci/cliThe CLI offers a set of commands to interact with the Zeus server. Besides specific parameters and options for each command, there is a range of common options:
zeus <command>
Commands:
zeus upload <file...> Upload build artifacts [aliases: u]
zeus completion generate bash completion script
Options:
--url Fully qualified URL to the Zeus server [string]
--token Token for authorized access to Zeus [string]
-v, --version Show version number [boolean]
-h, --help Show help [boolean]
The --url parameter defaults to https://zeus.ci. If you are running a
self-hosted version of Zeus, set this parameter to the fully qualified URL that
the server is listening to. The value can also be provided via the ZEUS_URL
environment variable. The command line option always takes precedence over the
environment.
Most commands require a token to authorize access. This can either be a personal
token obtained from the Account Settings Page
or a repository token obtained from the respective repository settings page. Use
the --token parameter or ZEUS_TOKEN environment variable to provide the
token.
The CLI also supports reading environment variables from a .env file located
in the current working directory. Note that command line parameters always
override the environment.
ZEUS_URL=https://zeus.ci
ZEUS_TOKEN=zeus-u-xxxxxxxxIn some environments, the CLI is able to infer parameters like build or job numbers and commit hashes for you. In this case, you can omit the respective paramters. These systems are:
- Travis CI
- AppVeyor
Upload a build artifact for processing or storage. The artifact is attached to a build and job. On supported CI systems, the build and job ids are automatically inferred from the environment.
Optionally, you can specify a mime type to classify the artifact with --type.
This is used to hint Zeus how the artifact should be processed. By default, the
mime type is inferred from the file name.
NOTE: This command still uses the legacy ZEUS_HOOK_BASE environment
variable. This requires a hook to be configured in the repository settings. In
future versions, this will be replaced with the default authorization tokens.
zeus upload <file...>
Positionals:
file Path to the artifact [array] [required] [default: []]
Options:
--url Fully qualified URL to the Zeus server [string]
--token Token for authorized access to Zeus [string]
-t, --type Mime type of the file to upload [string]
-j, --job Unique id of the job in CI [string]
-b, --build Unique id of the build in CI [string]
Examples:
# On a supported build server
zeus upload coverage.xml
# With explicit mime type
zeus upload -t 'text/xml+coverage' coverage.xml
# Multiple files
zeus upload -t 'application/javascript' build/**/*.js
# On a custom build server
zeus upload -b $MY_BUILD_ID -j $MY_JOB_ID -t 'text/xml+coverage' coverage.xmlOutput a script to generate command line completion suggestions.
# Linux
zeus completion >> ~/.bashrc
# macOS
zeus completion >> ~/.bash_profile# Install dependencies
yarn
# Run the bot
yarn start
# Run test watchers
yarn test:watchWe use prettier for auto-formatting and eslint as linter. Both tools can automatically fix a lot of issues for you. To invoke them, simply run:
yarn fixIt is highly recommended to use VSCode and install the suggested extensions. They will configure your IDE to match the coding style, invoke auto formatters every time you save and run tests in the background for you. No need to run the watchers manually.
