Skip to content

Commit

Permalink
Release: Add archive environment command kosli-dev/server#324 (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
ToreMerkely committed Jan 17, 2024
1 parent caf6d32 commit db86fb2
Show file tree
Hide file tree
Showing 88 changed files with 1,404 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs.kosli.com/assets/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"currentversion": "v2.7.3"}
{"currentversion": "v2.7.4"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "kosli archive environment"
beta: false
---

# kosli archive environment

## Synopsis

Archive a Kosli environment.
The environment will no longer be visible in list of environments, data is still stored in database.


```shell
kosli archive environment ENVIRONMENT-NAME [flags]
```

## Flags
| Flag | Description |
| :--- | :--- |
| -D, --dry-run | [optional] Run in dry-run mode. When enabled, no data is sent to Kosli and the CLI exits with 0 exit code regardless of any errors. |
| -h, --help | help for environment |


## Options inherited from parent commands
| Flag | Description |
| :--- | :--- |
| -a, --api-token string | The Kosli API token. |
| -c, --config-file string | [optional] The Kosli config file path. (default "kosli") |
| --debug | [optional] Print debug logs to stdout. A boolean flag https://docs.kosli.com/faq/#boolean-flags (default false) |
| -H, --host string | [defaulted] The Kosli endpoint. (default "https://app.kosli.com") |
| -r, --max-api-retries int | [defaulted] How many times should API calls be retried when the API host is not reachable. (default 3) |
| --org string | The Kosli organization. |


## Examples

```shell

# archive a Kosli environment:
kosli archive environment yourEnvironmentName \
--api-token yourAPIToken \
--org yourOrgName

```

46 changes: 46 additions & 0 deletions docs.kosli.com/content/client_reference/kosli_archive_flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: "kosli archive flow"
beta: false
---

# kosli archive flow

## Synopsis

Archive a Kosli flow.
The flow will no longer be visible in list of flows, data is still stored in database.


```shell
kosli archive flow FLOW-NAME [flags]
```

## Flags
| Flag | Description |
| :--- | :--- |
| -D, --dry-run | [optional] Run in dry-run mode. When enabled, no data is sent to Kosli and the CLI exits with 0 exit code regardless of any errors. |
| -h, --help | help for flow |


## Options inherited from parent commands
| Flag | Description |
| :--- | :--- |
| -a, --api-token string | The Kosli API token. |
| -c, --config-file string | [optional] The Kosli config file path. (default "kosli") |
| --debug | [optional] Print debug logs to stdout. A boolean flag https://docs.kosli.com/faq/#boolean-flags (default false) |
| -H, --host string | [defaulted] The Kosli endpoint. (default "https://app.kosli.com") |
| -r, --max-api-retries int | [defaulted] How many times should API calls be retried when the API host is not reachable. (default 3) |
| --org string | The Kosli organization. |


## Examples

```shell

# archive a Kosli flow:
kosli archive flow yourFlowName \
--api-token yourAPIToken \
--org yourOrgName

```

77 changes: 77 additions & 0 deletions docs.kosli.com/content/client_reference/kosli_snapshot_azure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: "kosli snapshot azure"
beta: false
---

# kosli snapshot azure

## Synopsis

Report a snapshot of running Azure web apps and function apps in an Azure resource group to Kosli.
The reported data includes Azure app names, container image digests and creation timestamps.

To authenticate to Azure, you need to create Azure service principal with a secret
and provide these Azure credentials via flags or by exporting the equivalent KOSLI env vars (e.g. KOSLI_AZURE_CLIENT_ID).
The service principal needs to have the following permissions:
1) Microsoft.Web/sites/Read
2) Microsoft.ContainerRegistry/registries/pull/read



```shell
kosli snapshot azure ENVIRONMENT-NAME [flags]
```

## Flags
| Flag | Description |
| :--- | :--- |
| --azure-client-id string | Azure client ID. |
| --azure-client-secret string | Azure client secret. |
| --azure-resource-group-name string | Azure resource group name. |
| --azure-subscription-id string | Azure subscription ID. |
| --azure-tenant-id string | Azure tenant ID. |
| --digests-source string | [defaulted] Where to get the digests from. Valid values are 'acr' and 'logs'. (default "acr") |
| -D, --dry-run | [optional] Run in dry-run mode. When enabled, no data is sent to Kosli and the CLI exits with 0 exit code regardless of any errors. |
| -h, --help | help for azure |
| --zip | Download logs from Azure as zip files |


## Options inherited from parent commands
| Flag | Description |
| :--- | :--- |
| -a, --api-token string | The Kosli API token. |
| -c, --config-file string | [optional] The Kosli config file path. (default "kosli") |
| --debug | [optional] Print debug logs to stdout. A boolean flag https://docs.kosli.com/faq/#boolean-flags (default false) |
| -H, --host string | [defaulted] The Kosli endpoint. (default "https://app.kosli.com") |
| -r, --max-api-retries int | [defaulted] How many times should API calls be retried when the API host is not reachable. (default 3) |
| --org string | The Kosli organization. |


## Examples

```shell

# Use Azure Container Registry to get the digests for artifacts in a snapshot
kosli snapshot azure yourEnvironmentName \
--azure-client-id yourAzureClientID \
--azure-client-secret yourAzureClientSecret \
--azure-tenant-id yourAzureTenantID \
--azure-subscription-id yourAzureSubscriptionID \
--azure-resource-group-name yourAzureResourceGroupName \
--digests-source acr \
--api-token yourAPIToken \
--org yourOrgName

# Use Docker logs of Azure apps to get the digests for artifacts in a snapshot
kosli snapshot azure yourEnvironmentName \
--azure-client-id yourAzureClientID \
--azure-client-secret yourAzureClientSecret \
--azure-tenant-id yourAzureTenantID \
--azure-subscription-id yourAzureSubscriptionID \
--azure-resource-group-name yourAzureResourceGroupName \
--digests-source logs \
--api-token yourAPIToken \
--org yourOrgName

```

3 changes: 2 additions & 1 deletion docs.kosli.com/content/helm/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The chart allows you to create a Kubernetes cronjob and all its necessary RBAC t

- A Kubernetes cluster
- Helm v3.0+
- Create a secret for the Kosli API token which will be used for reporting. You can create a secret by running: `kubectl create secret generic <secret-name> --from-literal=<secret-key>=<your-api-key>`

## Installing the chart

Expand Down Expand Up @@ -74,5 +75,5 @@ helm upgrade [RELEASE-NAME] kosli/k8s-reporter
| serviceAccount.name | string | `""` | the name of the service account to use. If not set and create is true, a name is generated using the fullname template |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0)

7 changes: 0 additions & 7 deletions docs.kosli.com/content/legacy_ref/v2.6.17/_index.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs.kosli.com/content/legacy_ref/v2.6.18/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: v2.6.18
bookCollapseSection: true
weight: 603
weight: 604
---

# v2.6.18
2 changes: 1 addition & 1 deletion docs.kosli.com/content/legacy_ref/v2.7.0/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: v2.7.0
bookCollapseSection: true
weight: 602
weight: 603
---

# v2.7.0
2 changes: 1 addition & 1 deletion docs.kosli.com/content/legacy_ref/v2.7.1/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: v2.7.1
bookCollapseSection: true
weight: 601
weight: 602
---

# v2.7.1
2 changes: 1 addition & 1 deletion docs.kosli.com/content/legacy_ref/v2.7.2/_index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: v2.7.2
bookCollapseSection: true
weight: 600
weight: 601
---

# v2.7.2
7 changes: 7 additions & 0 deletions docs.kosli.com/content/legacy_ref/v2.7.3/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: v2.7.3
bookCollapseSection: true
weight: 600
---

# v2.7.3
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ beta: false

## Synopsis

Assert a Azure DevOps pull request for a git commit exists.
Assert an Azure DevOps pull request for a git commit exists.
The command exits with non-zero exit code
if no pull requests were found for the commit.

Expand All @@ -20,7 +20,7 @@ kosli assert pullrequest azure [flags]
| :--- | :--- |
| --azure-org-url string | Azure organization url. E.g. "https://dev.azure.com/myOrg" (defaulted if you are running in Azure Devops pipelines: https://docs.kosli.com/ci-defaults ). |
| --azure-token string | Azure Personal Access token. |
| --commit string | Git commit for which to find pull request evidence. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). |
| --commit string | Git commit for which to find pull request evidence. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). (default "HEAD") |
| -D, --dry-run | [optional] Run in dry-run mode. When enabled, no data is sent to Kosli and the CLI exits with 0 exit code regardless of any errors. |
| -h, --help | help for azure |
| --project string | Azure project.(defaulted if you are running in Azure Devops pipelines: https://docs.kosli.com/ci-defaults ). |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ kosli assert pullrequest bitbucket [flags]
| --bitbucket-password string | Bitbucket App password. See https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication for more details. |
| --bitbucket-username string | Bitbucket username. |
| --bitbucket-workspace string | Bitbucket workspace ID. |
| --commit string | Git commit for which to find pull request evidence. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). |
| --commit string | Git commit for which to find pull request evidence. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). (default "HEAD") |
| -D, --dry-run | [optional] Run in dry-run mode. When enabled, no data is sent to Kosli and the CLI exits with 0 exit code regardless of any errors. |
| -h, --help | help for bitbucket |
| --repository string | Git repository. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kosli assert pullrequest github [flags]
## Flags
| Flag | Description |
| :--- | :--- |
| --commit string | Git commit for which to find pull request evidence. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). |
| --commit string | Git commit for which to find pull request evidence. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). (default "HEAD") |
| -D, --dry-run | [optional] Run in dry-run mode. When enabled, no data is sent to Kosli and the CLI exits with 0 exit code regardless of any errors. |
| --github-base-url string | [optional] GitHub base URL (only needed for GitHub Enterprise installations). |
| --github-org string | Github organization. (defaulted if you are running in GitHub Actions: https://docs.kosli.com/ci-defaults ). |
Expand All @@ -45,7 +45,6 @@ kosli assert pullrequest github [flags]
kosli assert pullrequest github \
--github-token yourGithubToken \
--github-org yourGithubOrg \
--commit yourArtifactGitCommit \
--commit yourGitCommit \
--repository yourGithubGitRepository

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kosli assert pullrequest gitlab [flags]
## Flags
| Flag | Description |
| :--- | :--- |
| --commit string | Git commit for which to find pull request evidence. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). |
| --commit string | Git commit for which to find pull request evidence. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). (default "HEAD") |
| -D, --dry-run | [optional] Run in dry-run mode. When enabled, no data is sent to Kosli and the CLI exits with 0 exit code regardless of any errors. |
| --gitlab-base-url string | [optional] Gitlab base URL (only needed for on-prem Gitlab installations). |
| --gitlab-org string | Gitlab organization. (defaulted if you are running in Gitlab Pipelines: https://docs.kosli.com/ci-defaults ). |
Expand All @@ -45,7 +45,6 @@ kosli assert pullrequest gitlab [flags]
kosli assert mergerequest gitlab \
--github-token yourGithubToken \
--github-org yourGithubOrg \
--commit yourArtifactGitCommit \
--commit yourGitCommit \
--repository yourGithubGitRepository

Expand Down
79 changes: 79 additions & 0 deletions docs.kosli.com/content/legacy_ref/v2.7.3/kosli_attest_artifact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: "kosli attest artifact"
beta: false
---

# kosli attest artifact

## Synopsis

Attest an artifact creation to a Kosli flow.
The artifact SHA256 fingerprint is calculated (based on --artifact-type flag) or alternatively it can be provided directly (with --fingerprint flag).

```shell
kosli attest artifact {IMAGE-NAME | FILE-PATH | DIR-PATH} [flags]
```

## Flags
| Flag | Description |
| :--- | :--- |
| -t, --artifact-type string | [conditional] The type of the artifact to calculate its SHA256 fingerprint. One of: [docker, file, dir]. Only required if you don't specify '--fingerprint'. |
| -b, --build-url string | The url of CI pipeline that built the artifact. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). |
| -g, --commit string | [defaulted] The git commit from which the artifact was created. (defaulted in some CIs: https://docs.kosli.com/ci-defaults, otherwise defaults to HEAD ). (default "HEAD") |
| -u, --commit-url string | The url for the git commit that created the artifact. (defaulted in some CIs: https://docs.kosli.com/ci-defaults ). |
| -N, --display-name string | [optional] Artifact display name, if different from file, image or directory name. |
| -D, --dry-run | [optional] Run in dry-run mode. When enabled, no data is sent to Kosli and the CLI exits with 0 exit code regardless of any errors. |
| -x, --exclude strings | [optional] The comma separated list of directories and files to exclude from fingerprinting. Only applicable for --artifact-type dir. |
| -F, --fingerprint string | [conditional] The SHA256 fingerprint of the artifact. Only required if you don't specify '--artifact-type'. |
| -f, --flow string | The Kosli flow name. |
| -h, --help | help for artifact |
| -n, --name string | The name of the artifact in the yml template file. |
| --registry-password string | [conditional] The docker registry password or access token. Only required if you want to read docker image SHA256 digest from a remote docker registry. |
| --registry-provider string | [conditional] The docker registry provider or url. Only required if you want to read docker image SHA256 digest from a remote docker registry. |
| --registry-username string | [conditional] The docker registry username. Only required if you want to read docker image SHA256 digest from a remote docker registry. |
| --repo-root string | [defaulted] The directory where the source git repository is available. (default ".") |
| -T, --trail string | The Kosli trail name. |


## Options inherited from parent commands
| Flag | Description |
| :--- | :--- |
| -a, --api-token string | The Kosli API token. |
| -c, --config-file string | [optional] The Kosli config file path. (default "kosli") |
| --debug | [optional] Print debug logs to stdout. A boolean flag https://docs.kosli.com/faq/#boolean-flags (default false) |
| -H, --host string | [defaulted] The Kosli endpoint. (default "https://app.kosli.com") |
| -r, --max-api-retries int | [defaulted] How many times should API calls be retried when the API host is not reachable. (default 3) |
| --org string | The Kosli organization. |


## Examples

```shell

# Attest to a Kosli flow that a file type artifact has been created
kosli attest artifact FILE.tgz \
--artifact-type file \
--build-url https://exampleci.com \
--commit-url https://github.com/YourOrg/YourProject/commit/yourCommitShaThatThisArtifactWasBuiltFrom \
--git-commit yourCommitShaThatThisArtifactWasBuiltFrom \
--flow yourFlowName \
--trail yourTrailName \
--name yourTemplateArtifactName \
--api-token yourApiToken \
--org yourOrgName


# Attest to a Kosli flow that an artifact with a provided fingerprint (sha256) has been created
kosli attest artifact ANOTHER_FILE.txt \
--build-url https://exampleci.com \
--commit-url https://github.com/YourOrg/YourProject/commit/yourCommitShaThatThisArtifactWasBuiltFrom \
--git-commit yourCommitShaThatThisArtifactWasBuiltFrom \
--flow yourFlowName \
--fingerprint yourArtifactFingerprint \
--trail yourTrailName \
--name yourTemplateArtifactName \
--api-token yourApiToken \
--org yourOrgName

```

Loading

0 comments on commit db86fb2

Please sign in to comment.