78 lines
No EOL
1.7 KiB
Markdown
78 lines
No EOL
1.7 KiB
Markdown
# processing bootstrap
|
|
|
|
Simple folder-based script execution environment designed for modularity.
|
|
|
|
Suitable for the automation tasks as a better alternative to a Behemoth-class monolithic scripts.
|
|
|
|
Script execution order is a simple alphanumeric sort by a file name. Scripts are executed from a directories with '\d+-\w+' name pattern
|
|
|
|
# Usage example
|
|
|
|
```
|
|
- 10-init \
|
|
10-load-environment.ps1
|
|
|
|
- 20-functions \
|
|
server-connection.ps1
|
|
data-mangling.ps1
|
|
|
|
- 50-exec \
|
|
10-connect-server.ps1
|
|
30-doing-the-needful.ps1
|
|
99-disconnect-server.ps1
|
|
|
|
- config \
|
|
server-credentials.json
|
|
|
|
- data \
|
|
salsa-scheme.xml
|
|
|
|
start.ps1
|
|
|
|
```
|
|
|
|
# Directory structure
|
|
|
|
### config
|
|
|
|
Place configuration files here, like server names, credentials, apikeys etc.
|
|
|
|
Files with .json extension would be autoloaded under $BS.config.filename variable
|
|
|
|
### data
|
|
|
|
Use it for the work data like temp files and so on.
|
|
|
|
### psmodule
|
|
|
|
If you need to load specific PS modules (not installed in the system or in the user profile) then you can copy them there and they would be automatically imported by PowerShell itself through $PSModules
|
|
|
|
### lib
|
|
|
|
.NET assemblies would be autoloaded from here, place the DLLs in the net4 directory for PS5 and net7 for PwSh7+
|
|
|
|
### submodule
|
|
|
|
Place *git* submodules here
|
|
|
|
### docs
|
|
|
|
You do write the docs?
|
|
|
|
# Using in the other project tracked by git
|
|
|
|
Consider using `git submodule`:
|
|
|
|
```sh
|
|
mkdir submodule
|
|
cd submodule
|
|
git submodule add https://$SITENAME/processing-bootstrap.git
|
|
```
|
|
|
|
Then use it from the root of your project:
|
|
|
|
```
|
|
pushd $PSScriptRoot
|
|
. ./submodule/processing-bootstrap/start.ps1 -Root $PSScriptRoot
|
|
popd
|
|
``` |