forked from microsoft/PSRule
-
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.
Add lock file support microsoft#1660 (microsoft#1661)
- Loading branch information
1 parent
3ee8c19
commit 280508e
Showing
27 changed files
with
1,068 additions
and
63 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
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,25 @@ | ||
# PSRule CLI | ||
|
||
!!! Abstract | ||
PSRule provides a command-line interface (CLI) to run rules and analyze results. | ||
This article describes the commands available in the CLI. | ||
|
||
## `analyze` | ||
|
||
Run rule analysis. | ||
|
||
## `module add` | ||
|
||
Add one or more modules to the lock file. | ||
|
||
## `module remove` | ||
|
||
Remove one or more modules from the lock file. | ||
|
||
## `module upgrade` | ||
|
||
Upgrade to the latest versions any modules within the lock file. | ||
|
||
## `restore` | ||
|
||
Restore modules defined in configuration locally. |
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,33 @@ | ||
# Lock file | ||
|
||
!!! Abstract | ||
PSRule v3 and later uses a lock file to define the modules and versions used to run analysis. | ||
This article describes the lock file and how to manage it. | ||
|
||
## Overview | ||
|
||
An optional lock file can be used to define the modules and versions used to run analysis. | ||
Using the lock file ensures that the same modules and versions are used across multiple machines, improving consistency. | ||
|
||
- **Lock file is present** - PSRule will use the module versions defined in the lock file. | ||
- **Lock file is not present** - PSRule will use the latest version of each module installed locally. | ||
|
||
Name | Supports lock file | ||
---- | ------------------ | ||
PowerShell | No | ||
CLI | Yes, v3 and later | ||
GitHub Actions | Yes, v3 and later | ||
Azure Pipelines | Yes, v3 task and later | ||
Visual Studio Code | Yes, v3 and later | ||
|
||
!!! Important | ||
The lock file only applies to PSRule outside of PowerShell. | ||
When using PSRule as a PowerShell module, the lock file is ignored. | ||
|
||
## Restoring modules | ||
|
||
When the lock file is present, PSRule will restore the modules and versions defined in the lock file. | ||
|
||
<!-- Modules are automatically restored by PSRule when: | ||
- Running analysis with --> |
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,10 @@ | ||
{ | ||
"modules": { | ||
"PSRule.Rules.MSFT.OSS": { | ||
"version": "1.1.0" | ||
}, | ||
"PSRule.Rules.Azure": { | ||
"version": "1.30.0" | ||
} | ||
} | ||
} |
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,29 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"title": "PSRule lock", | ||
"description": "A schema for the PSRule lock file.", | ||
"properties": { | ||
"modules": { | ||
"type": "object", | ||
"title": "Modules", | ||
"additionalProperties": { | ||
"type": "object", | ||
"properties": { | ||
"version": { | ||
"type": "string", | ||
"title": "Version" | ||
} | ||
}, | ||
"required": [ | ||
"version" | ||
], | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"modules" | ||
], | ||
"additionalProperties": false | ||
} |
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
Oops, something went wrong.