-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add what-do-i-do-if-kosli-is-down tutorial (linked from faq)
- Loading branch information
Showing
8 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ If you can't find the answer you're looking for please: | |
* email us at [[email protected]](mailto:[email protected]) | ||
* join our slack community [here](https://join.slack.com/t/koslicommunity/shared_invite/zt-1dlchm3s7-DEP6TKjP3Mr58OZVB3hCBw) | ||
|
||
## What do I do if Kosli is down? | ||
|
||
There is a [tutorial](/tutorials/what_do_i_do_if_kosli_is_down/) dedicated to this. | ||
|
||
## Why am I getting "unknown flag" error? | ||
|
||
If you see an error like below (or similar, with a different flag): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
docs.kosli.com/content/tutorials/what_do_i_do_if_kosli_is_down.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
title: "What do I do if Kosli is down?" | ||
bookCollapseSection: false | ||
weight: 507 | ||
--- | ||
|
||
# What do I do if Kosli is down? | ||
|
||
Customers use Kosli to attest evidence of their business and software processes. | ||
If Kosli is down, these attestations will fail. | ||
This will break CI workflow pipelines, blocking artifacts from being deployed. | ||
In this situation there is a built-in mechanism to instantly turn Kosli off and keep the pipeline flowing. | ||
When Kosli is back up, you can instantly turn Kosli back on. | ||
|
||
## Turning Kosli CLI calls on and off instantly | ||
|
||
If the `KOSLI_DRY_RUN` environment variable is set to `true` then all Kosli CLI commands will: | ||
* Not communicate with Kosli at all | ||
* Print the payload they would have sent | ||
* Exit with a zero status code | ||
|
||
We recommend creating an Org-level KOSLI_DRY_RUN variable in your CI system and, in all CI workflows, | ||
ensuring there is an environment variable set from it. | ||
|
||
For example, in a [Github Action workflow](https://github.com/cyber-dojo/differ/blob/main/.github/workflows/main.yml): | ||
|
||
```yaml | ||
name: Main | ||
... | ||
env: | ||
KOSLI_DRY_RUN: ${{ vars.KOSLI_DRY_RUN }} # true iff Kosli is down | ||
``` | ||
## Turning Kosli API calls on and off instantly | ||
If you are using the Kosli API in your workflows (e.g. using `curl`), we recommend using the same Org-level `KOSLI_DRY_RUN` | ||
environment variable and guarding the `curl` call with a simple if statement. For example: | ||
|
||
```shell | ||
#!/usr/bin/env bash | ||
kosli_curl() | ||
{ | ||
local URL="${1}" | ||
local JSON_PAYLOAD="${2}" | ||
if [ "${KOSLI_DRY_RUN:-}" == "true" ]; then | ||
echo KOSLI_DRY_RUN is set to true. This is the payload that would have been sent | ||
echo "${JSON_PAYLOAD}" | jq . | ||
else | ||
curl ... --data="${JSON_PAYLOAD}" "${URL}" | ||
fi | ||
} | ||
``` | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters