GitSources.Tools
GitSources.Tools builds a deployment package out of a Git checkout during an automated build. Point it at a DataStar deployment file and it gathers the referenced scripts (at the commit each one was pinned to) and wraps them into a single artefact, ready for release.
It's published to NuGet and installs as a global dotnet tool:
dotnet tool install --global GitSources.Tool --version 1.*
How it works
A DataStar deployment file lists every script the release needs, together with the Git commit SHA that version of each script came from. GitSources.Tools reads the file, pulls each script at the pinned commit, and packages the set. Lenient modes are available if you'd rather use the latest commit of each file, or fall back to the latest when a pinned commit is missing.
The deployment file itself can live anywhere. If it's checked into the Git repo, use --build-commit or --build-tag to pick the version. If an agile tool stores the file (for example, attached to a Jira story or Azure Boards work item), download it as a separate build step and point --build-file at the local copy.
Running the CLI
dotnet-gitsources [options]
| Switch | Long name | Type | Description |
|---|---|---|---|
-ad | --artifacts-directory | String | Output directory for the packaged artefacts. |
-bc | --build-commit | String | Take the deployment file from the Git repo at the specified commit. Located via the manifest regex. |
-bf | --build-file | String | Build from a deployment file already present on disk. Use when the file comes from an external source (Jira, Azure Boards). |
-bt | --build-tag | String | Take the deployment file from the Git repo at the specified tag. Located via the manifest regex. |
-gd | --git-directory | String | Path to the root of the Git repository. |
-ll | --log-level | String | Log verbosity. For example, debug enables debug logging. |
-mr | --manifest.regexp | String | Regex for matching deployment files. Defaults to any file with an .xml suffix. |
-od | --output-directory | String | Output directory for any supporting outputs. |
-pa | --package-author | String | Author, for the generated NuGet package. |
-pf | --package-file | String | Filename, for the generated NuGet package. |
-pk | --package-id | String | Package id, for the generated NuGet package. |
-ps | --package-summary | String | Description, for the generated NuGet package. |
-pv | --package-version | String | Package version, for the generated NuGet package. |
-vi | --version.ignore | Flag | Ignore the commit pinned in the manifest; use the latest version of each file in the repo. |
-vl | --version.lenient | Flag | Prefer the pinned commit, but fall back to the latest version when the pinned commit is missing. |
Flag value types
| Type | Meaning |
|---|---|
| Flag | No value expected after the switch. |
| String | A string argument follows the switch. |