-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update mod docs for new options for installing from tags, branches, local * update docs for new mod dependency types * add docs for POWERPIPE_GIT_TOKEN * proofread fixes * remove --pull none from mod reference docs
- Loading branch information
Showing
6 changed files
with
196 additions
and
16 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 |
---|---|---|
|
@@ -66,3 +66,62 @@ powerpipe benchmark run aws_compliance.benchmark.cis_v140 | |
``` | ||
|
||
When running `powerpipe server` from a mod, all dashboards in your mod and its direct dependencies will be available to run. | ||
|
||
|
||
## Installing Mods | ||
|
||
### Git URLs & Private Repos | ||
|
||
Powerpipe uses `git` to install and update mods. When you run `powerpipe mod install` or `powerpipe mod update`, Powerpipe will first try using HTTPS and if that does not work it will try SSH. If your SSH keys are configured properly for `git`, you should be able to pull from private repos that you have access to, as well as public ones. Alternatively, you can authenticate with a GitHub personal access token or application token. Set the [POWERPIPE_GIT_TOKEN](/docs/reference/env-vars/powerpipe_git_token) environment variable to your token and Powerpipe will use the token when installing and updating mods. | ||
|
||
|
||
### Mod Version Constraints | ||
|
||
When installing a mod, you may specify a [semver constraint](https://semver.org/). The latest version that meets the constraint will be installed, and the constraint will be added to the `mod.pp` and honored by subsequent `steampipe mod update` operations. | ||
|
||
When installing the mod, append the mod repo with `@` and any valid semver constraint: | ||
|
||
```bash | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights@'^1' | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights@1 | ||
powerpipe mod install github.com/turbot/[email protected] | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights@'>=0.20' | ||
``` | ||
|
||
### Installing from Branches and Tags | ||
|
||
To install from a tagged commit, append the mod repo with `@` and the tag: | ||
```bash | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights@mycustomtag' | ||
``` | ||
Note that the syntax is the same as for [semver constraints](#mod-version-constraints), and if the tag value is a valid semver string, Powerpipe will interpret it as a semver constraint and not a literal tag name. | ||
To install from a branch, append the mod repo with `#` and the branch name: | ||
```bash | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights#main' | ||
``` | ||
|
||
### Installing from the local filesystem | ||
When developing mods, it can be useful to work from a local copy. To install a mod from a local filesystem path, just pass the path to the install command: | ||
|
||
```bash | ||
powerpipe mod install ../steampipe-mod-aws-insights | ||
``` | ||
|
||
|
||
### Update Strategy | ||
|
||
It is also possible to have more granular control of the update behavior - e.g. when to check for new commits. The -`-pull` argument can be used to specify the update strategy when running `powerpipe update` or `powerpipe install`: | ||
|
||
| Strategy | Description | ||
|----------|--------------------------------------------------- | ||
| `full` | Check branches and tags for both latest and accuracy | ||
| `latest` | Update everything to latest, but only branches (not tags) are commit checked | ||
| `development` | Update branches and broken constraints to latest, leave satisfied constraints unchanged | ||
| `minimal`| Only update broken constraints. Do not check branches for new commits | ||
|
||
|
||
### Publishing & Distributing mods | ||
When publishing public mods, you should only depend on public mods (hosted in public repos) so that users of your mod don't encounter permissions issues - Avoid dependencies on local or private mods! | ||
|
||
When users install your mod using `powerpipe mod install`, your dependencies will get installed automatically. As a result, it is recommended that you add the `.powerpipe` directory to your `.gitignore` file and do not check these files into git. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,42 +56,93 @@ powerpipe mod init --mod-location ~/my_mod | |
--- | ||
|
||
## powerpipe mod install | ||
Install one or more mods and their dependencies. | ||
Install one or more mods and their dependencies. In addition to downloading the mod, Powerpipe will [add the mod dependency to the `mod.pp` file](/docs/powerpipe-hcl/mod#mod-1). | ||
|
||
Powerpipe uses `git` to install and update mods. When you run `powerpipe mod install` or `powerpipe mod update`, Powerpipe will first try using HTTPS and if that does not work it will try SSH. If your SSH keys are configured properly for `git`, you should be able to pull from private repos that you have access to, as well as public ones. Alternatively, you can authenticate with a GitHUb personal access token or application token. Set the [POWERPIPE_GIT_TOKEN](/docs/reference/env-vars/powerpipe_git_token) environment variable to your token and Powerpipe will use the token when installing and updating mods. | ||
|
||
When you install a mod, the latest version is installed by default: | ||
```bash | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights | ||
``` | ||
|
||
When installing a mod, you may specify a semver constraint. The latest version that meets the constraint will be installed, and the constraint will be added to the `mod.pp` and honored by subsequent `steampipe mod update` operations. | ||
```bash | ||
powerpipe mod install github.com/turbot/[email protected] | ||
``` | ||
|
||
To install from a tagged commit, append the mod repo with `@` and the tag: | ||
```bash | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights@mycustomtag | ||
``` | ||
Note that the syntax is the same as for semver constraints, and if the tag value is a valid semver string, Powerpipe will interpret it as a semver constraint and not a literal tag name. | ||
|
||
To install from a branch, append the mod repo with `#` and the branch name: | ||
```bash | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights#main | ||
``` | ||
|
||
When developing mods, it can be useful to work from a local copy. To install a mod from a local filesystem path, just pass the path to the install command: | ||
|
||
```bash | ||
powerpipe mod install ../steampipe-mod-aws-insights | ||
``` | ||
|
||
### Arguments | ||
| Flag | Description | ||
|-|- | ||
| `--dry-run` | Show which mods would be installed/updated/uninstalled without modifying them (default `false`). | ||
| `--force` | Install mods even if plugin/cli version requirements are not met (cannot be used with `--dry-run`). | ||
| `--prune` | Remove unused dependencies after installation is complete (default `true`). | ||
| `--pull string` | Specify an [update strategy](#update-strategy): `full`, `latest`, `development`, `minimal` (default `minimal`) | ||
|
||
|
||
#### Update Strategy | ||
|
||
### Git URLs & Private Repos | ||
It is also possible to have more granular control of the update behavior - e.g. when to check for new commits. The -`-pull` argument can be used to specify the update strategy when running `powerpipe update` or `powerpipe install`: | ||
|
||
Powerpipe uses `git` to install and update mods. When you run `powerpipe mod install` or `powerpipe mod update`, Powerpipe will first try using HTTPS and if that does not work it will try SSH. If your SSH keys are configured properly for `git`, you should be able to pull from private repos that you have access to, as well as public ones. | ||
| Strategy | Description | ||
|----------|--------------------------------------------------- | ||
| `full` | Check branches and tags for both latest and accuracy | ||
| `latest` | Update everything to latest, but only branches (not tags) are commit checked | ||
| `development` | Update branches and broken constraints to latest, leave satisfied constraints unchanged | ||
| `minimal`| Only update broken constraints. Do not check branches for new commits | ||
|
||
|
||
### Examples | ||
|
||
Install the latest version of a mod and add the `require` statement to your `mod.pp`: | ||
Install the latest version of a mod: | ||
```bash | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights | ||
``` | ||
|
||
Install an exact version of a mod and update the `require` statement to your `mod.pp`. This may upgrade or downgrade the mod if it is already installed: | ||
Install an exact version of a mod: | ||
```bash | ||
powerpipe mod install github.com/turbot/[email protected] | ||
``` | ||
|
||
Install a version of a mod using a semver constraint and update the `require` statement to your `mod.pp`. This may upgrade or downgrade the mod if it is already installed: | ||
Install a version of a mod using a semver constraint: | ||
```bash | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights@'^1' | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights@1 | ||
powerpipe mod install github.com/turbot/[email protected] | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights@'>=0.20' | ||
``` | ||
|
||
Install a mod from a GitHub tag: | ||
```bash | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights@my-tag | ||
``` | ||
|
||
Install a mod from a GitHub branch: | ||
```bash | ||
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights#main | ||
``` | ||
|
||
Install a mod from a local directory: | ||
```bash | ||
powerpipe mod install ../steampipe-mod-aws-insights | ||
``` | ||
|
||
Install all mods specified in the `mod.pp` and their dependencies: | ||
```bash | ||
powerpipe mod install | ||
|
@@ -102,8 +153,14 @@ Preview what `powerpipe mod install` will do, without actually installing anythi | |
powerpipe mod install --dry-run | ||
``` | ||
|
||
Install all missing mods specified in the `mod.pp` and update all their dependencies: | ||
```bash | ||
powerpipe mod install --pull full | ||
``` | ||
|
||
--- | ||
|
||
|
||
## powerpipe mod list | ||
List mods from the current mod and its direct dependents. | ||
|
||
|
@@ -185,6 +242,7 @@ Update one or more mods and their dependencies. | |
|` --dry-run` | Show which mods would be updated without modifying them (default `false`). | ||
|` --force` | Update mods even if plugin/cli version requirements are not met (cannot be used with `--dry-run`). | ||
|` --prune` | Remove unused dependencies after update is complete (default `true`). | ||
| `--pull string` | Specify an [update strategy](#update-strategy): `full`, `latest`, `development`, `minimal` (default `latest`) | ||
|
||
|
||
### Examples | ||
|
@@ -200,5 +258,10 @@ Update all mods specified in the `mod.pp` and their dependencies to the latest v | |
powerpipe mod update | ||
``` | ||
|
||
---- | ||
|
||
Update all mods specified in the `mod.pp` and their dependencies to the latest versions that meet their constraints, and install any that are missing. Check branches and tags for both latest and accuracy: | ||
```bash | ||
powerpipe mod update --pull full | ||
``` | ||
|
||
--- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: POWERPIPE_GIT_TOKEN | ||
sidebar_label: POWERPIPE_GIT_TOKEN | ||
--- | ||
|
||
|
||
# POWERPIPE_GIT_TOKEN | ||
|
||
Set a GitHub personal access token or application token to use when installing mods from Github. | ||
|
||
Powerpipe uses `git` to install and update mods. When you run `powerpipe mod install` or `powerpipe mod update`, Powerpipe will first try using HTTPS and if that does not work it will try SSH. If your SSH keys are configured properly for `git`, you should be able to pull from private repos that you have access to, as well as public ones. Alternatively, you can authenticate with a GitHub personal access token or application token. Set the `POWERPIPE_GIT_TOKEN` environment variable to your token and Powerpipe will use the token when installing and updating mods. | ||
|
||
|
||
## Usage | ||
Set your API token: | ||
```bash | ||
export POWERPIPE_GIT_TOKEN=ghp_1t2ieaXluThisIsAFakeTokenG2ei14Q1PBJ | ||
``` |
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