GitHub action to setup the Ontrack CLI.
Version of the Ontrack CLI to install. If not specified, defaults to the latest available.
Repository owner for which to activate the Ontrack setup.
This is useful when the Ontrack setup can only be done for a given organisation or user.
URL of the Ontrack instance to target. If this input is set and the token
one as well, this action will setup the CLI based on this information.
Authentication token to use to connect to Ontrack (required if URL is set). If this input is set and the url
one as well, this action will setup the CLI based on this information.
Optional name of the configuration to create for the CLI. Defaults to prod
.
Optional name of the configuration in Ontrack holding the GitHub connection. If set, this action will setup the project and branch in Ontrack based on the available information.
Indexation interval of the GitHub repository in GitHub (in minutes). Defaults to 0
(no indexation required).
GitHub token to get the latest version of the CLI (when version
is not provided).
Sets the Ontrack project to create validation stamps on demand.
Value can be:
true
or"true"
- auto creation based on predefined validation stamps"force"
- auto creation even if no predefined validation stamps- otherwise, no auto creation
Sets the Ontrack project to create promotion levels on demand.
Optional path to a YAML file describing the auto promotions for this project.
The target file format looks like:
BRONZE:
validations:
- BUILD
SILVER:
validations:
- ACCEPTANCE
promotions:
- BRONZE
Version which has actually been installed.
Name of the Ontrack project
Name of the Ontrack branch
Setting the CLI automatically:
- name: Setup the CLI
uses: nemerosa/ontrack-github-actions-cli-setup@v1
with:
github-token: ${{ github.token }}
only-for: nemerosa
url: <ontrack-url>
token: ${{ secrets.ONTRACK_TOKEN }}
config: github.com
indexation: 120
# This:
# 1. installs the CLI
# 2. sets up the CLI
# 3. creates or updates the project in Ontrack
# 3. creates or updates the branch in Ontrack
# You can then use `ontrack-cli` directly
Setting a project and branch manually:
- name: Setup the CLI
uses: nemerosa/ontrack-github-actions-cli-setup@v1
# You can then use `ontrack-cli` directly
- name: Connect to Ontrack
run: ontrack-cli config create prod <ontrack-url> --token <token>
- name: Branch setup
run: ontrack-cli branch setup --project <project> --branch <branch>
See the ontrack-cli
documentation for more examples.
Other GitHub actions can be used after the ontrack-github-actions-cli-setup
in order to leverage the Ontrack CLI:
ontrack-github-actions-cli-validation
- creates validations for builds, using information available in the GitHub workflow
Download the dependencies by running:
npm install
To build the distribution:
ncc build