-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support fallback environment source branch (#146)
* feat: Add TeamCity Environment Introduces TeamCity Environment detection based on TEAMCITY_VERSION variable. Implements #141 * chore: Remove Teamcity specific implementation * chore: Ignore Resharper assets * feature: Enable BaseVersionEnvironment to resolve branch environment variable Exposes `simpleversion.sourcebranch` to environments by default * feature: Expose default environment branhc to all * docs: Environments section added * fix: Correct broken tests Co-authored-by: Anna Moser <[email protected]>
- Loading branch information
1 parent
49e1600
commit 4fc670e
Showing
9 changed files
with
101 additions
and
25 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 |
---|---|---|
|
@@ -13,3 +13,4 @@ testResults.xml | |
coverage.xml | ||
coverage.cobertura.xml | ||
*.trx | ||
*.DotSettings.user |
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
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,26 @@ | ||
Environments | ||
============ | ||
|
||
SimpleVersion attempts to identify git information from the local environment. | ||
When running on Continuous Integration (CI) systems you may need to prepare the | ||
environment to cater for the CI systems specific approach to builds. | ||
|
||
Azure Devops | ||
------------ | ||
|
||
Azure Devops is identified as the build environment when the environment variable `TF_BUILD` is set. | ||
|
||
When identified, the canonical and friendly branch names are derived from the `BUILD_SOURCEBRANCH` environment variable. | ||
|
||
Fallback Environment | ||
-------------------- | ||
|
||
For all environments, the build branch can be overridden by setting `simpleversion.sourcebranch` to the _full canonical branch name_. When this variable is set it will override the resolution from any CI system as well as the local repository branch name. | ||
|
||
### TeamCity | ||
|
||
When building with TeamCity you can lift the branch name of the build to an environment variable by doing the following: | ||
|
||
1. Open your build configuration, and select Parameters | ||
1. Add a new paramter called `env.simpleversion.sourcebranch` | ||
1. Set the value to `%teamcity.build.vcs.branch.{vcsid}%` where `{vcsid}` is the VCS Root of your repo |
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
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