Skip to content

Commit 8e609dc

Browse files
committed
Update jenkins.md docs, for GitTools#313
1 parent ff56dfd commit 8e609dc

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Jenkins Setup
2+
3+
Injecting environment variables is not supported in Jenkins natively, but Jenkins plugins exist that provide this functionality. Of these plugins [EnvInject] appears to be the most popular with over 20k downloads per month.
4+
5+
To inject the GitVersion variables as environment variables for a build job using [EnvInject], do the following:
6+
7+
1. Add a **Execute Windows batch command** build step with command:
8+
`gitversion /output props > gitversion.properties`
9+
1. Add a **Inject environment variables** build step and use value 'gitversion.properties" for the "Properties File Path" parameter
10+
11+
You can verify correct inject of environment variables by adding another "Execute Windows batch command" build step with the following command:
12+
13+
```
14+
@echo Retrieving some GitVersion environment variables:
15+
@echo %gitversion.SemVer%
16+
@echo %gitversion.BranchName%
17+
@echo %gitversion.AssemblySemVer%
18+
@echo %gitversion.MajorMinorPatch%
19+
@echo %gitversion.Sha%
20+
```
21+
22+
[EnvInject]: https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin

0 commit comments

Comments
 (0)