Nobl9 provides a GitHub Action via the GitHub Marketplace that you can leverage to ensure your SLOs are updated in Nobl9 whenever you change the SLO definitions in the source code.
What are GitHub Actions?
GitHub Actions is a continuous integration (CI) and continuous delivery (CD) platform using YAML syntax. It lets you build, test, and deploy code from your source code repository on https://github.com. For example, if you want to test every pull request made to your repository automatically, you must configure the GitHub Actions workflow to trigger a series of commands. Workflows are defined as YAML files in your code repository in a
.github/workflows directory. One workflow references one or more GitHub Actions together as a series of instructions, where each instruction executes a specific task.
For more detailed information on GitHub Actions, refer to the Learn GitHub Actions | GitHub Docs.
GitHub Actions in Nobl9
Nobl9 allows you to create and manage SLOs using YAML configuration files. You can define your SLOs in code and apply the changes using
sloctl, the Nobl9 command-line interface. The SLOs you create in the SLO wizard can also be retrieved and edited as YAML files. For more information, refer to the sloctl user guide.
The Nobl9 GitHub Action applies a configuration file,
specified with the
sloctl_yml input parameter, to a project using
With it, you can ensure your SLOs are up-to-date every time you make changes to your repository.
The SLOs defined in the YAML file leverage repository versioning and can be checked in parallel with your code.
With every build, you can be sure that the associated application’s SLOs are also updated in Nobl9.
Setting up GitHub Action in Nobl9
Follow these steps to set up GitHub Actions:
- Go to the page for the Nobl9 sloctl action in the GitHub Marketplace.
Click the Use latest version button and copy the snippet.
Paste the snippet in your workflow .yml file at the step that makes sense in your build flow, for example:
name: Nobl9 GitHub Actions Demo
- name: Check out repository code
- uses: firstname.lastname@example.org
client_id: # secrets.CLIENT_ID
client_secret: # secrets.CLIENT_SECRET
access_token: # secrets.ACCESS_TOKEN
Add the Actions secrets to your workflow .yml file:
The variables are:
ACCESS_TOKEN- a JWT token retrieved from Okta, used by
sloctlto authenticate with Nobl9. You can retrieve the Access Token in two ways:
Use the Nobl9 API by following the steps described here.
If you have
sloctlinstalled on your local machine, use the following command:
grep accessToken ~/.config/nobl9/config.toml
CLIENT_ID- the Client ID of your Nobl9 account. For information on creating a Client ID, refer to the sloctl user guide.
CLIENT_SECRET- the Client Secret of your Nobl9 account. For information on creating a Client Secret, refer to the sloctl user guide.
PROJECT- the name of the project to which the
sloctlconfiguration will be applied.
SLOCTL_YML- the path to the
sloctlYAML configuration file, relative to the root directory of the repository.
Once you set up the Nobl9 GitHub Action, every build updates Nobl9 with your SLOs' YAML definitions.