Skip to main content

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]
SwitchLong nameTypeDescription
-ad--artifacts-directoryStringOutput directory for the packaged artefacts.
-bc--build-commitStringTake the deployment file from the Git repo at the specified commit. Located via the manifest regex.
-bf--build-fileStringBuild from a deployment file already present on disk. Use when the file comes from an external source (Jira, Azure Boards).
-bt--build-tagStringTake the deployment file from the Git repo at the specified tag. Located via the manifest regex.
-gd--git-directoryStringPath to the root of the Git repository.
-ll--log-levelStringLog verbosity. For example, debug enables debug logging.
-mr--manifest.regexpStringRegex for matching deployment files. Defaults to any file with an .xml suffix.
-od--output-directoryStringOutput directory for any supporting outputs.
-pa--package-authorStringAuthor, for the generated NuGet package.
-pf--package-fileStringFilename, for the generated NuGet package.
-pk--package-idStringPackage id, for the generated NuGet package.
-ps--package-summaryStringDescription, for the generated NuGet package.
-pv--package-versionStringPackage version, for the generated NuGet package.
-vi--version.ignoreFlagIgnore the commit pinned in the manifest; use the latest version of each file in the repo.
-vl--version.lenientFlagPrefer the pinned commit, but fall back to the latest version when the pinned commit is missing.

Flag value types

TypeMeaning
FlagNo value expected after the switch.
StringA string argument follows the switch.