You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added initial versions of PowerShell script to build the provider
* Updated Powershell build scripts
* Added parameter -SkipTests to scripts\build.ps1
* Fixed trailing whitespaces for scripts\build.ps1 and scripts\unittest.ps1
* Initial check in scripts\local-install.ps1
* scripts\build.ps1 will add .exe extension on Windows
* scripts\local-install.ps1 now installes provider on Windows correctly
* Added parameter -Install scripts\build.ps1
* Fixed a spelling error of System namespace in scripts\local-install.ps1
* Initial check in of scripts\acctest.ps1 and added tags support in scripts\unittest.ps1
* Added same parameters to scripts\unittest.ps1 as scripts\acctest.ps1
* Added validation to -Tags parameter in scripts\acctest.ps1
* Added -DebugBuild parameter to scripts\build.ps1
* Forcing LF line ending for GO files
* Added scripts\gofmtcheck.ps1
* Added missing -s flag to gofmt in scripts\gofmtcheck.ps1
* Added scripts\lint-check-go.ps1
* Added link to Gitter channel and Go Report Card back to README.md
* * Added parameter -GoMod to control the -mod build flag
* Added missing environment variables during build
* Added cleanup process for build environment variables
* Removed unsupported -Fix parameter from scripts\lint-check-go.ps1
* Added documentation for developing on Windows
Co-authored-by: Thomas Meckel <tmeckel@users.noreply.github.com>
*[Go](https://golang.org/doc/install) version 1.13.x (to build the provider plugin)
51
55
52
56
If you're on Windows you'll also need:
57
+
*[Git for Windows](https://git-scm.com/download/win)
58
+
59
+
If you what to use the `makefile` build strategy on Windows it's required to install
60
+
53
61
*[Make for Windows](http://gnuwin32.sourceforge.net/packages/make.htm)
54
-
*[Git Bash for Windows](https://git-scm.com/download/win)
55
62
56
63
For *GNU32 Make*, make sure its bin path is added to PATH environment variable.*
57
64
58
65
For *Git Bash for Windows*, at the step of "Adjusting your PATH environment", please choose "Use Git and optional Unix tools from Windows Command Prompt".*
59
66
67
+
As [described below](#build-using-powerShell-scripts) we provide some PowerShell scripts to build the provider on Windows, without the requiremet to install any Unix based tools aside Go.
68
+
60
69
## Developing the Provider
61
70
62
71
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.13+ is **required**). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
63
72
73
+
### Using the GOPATH model
74
+
64
75
First clone the repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provider-azuredevops`
The infrastructure supports building and testing the provider outside `GOPATH` in an arbitrary directory.
86
+
In this scenario all required packages of the provider during build will be managed via the `pkg` in `$GOPATH`. As with the [GOPATH Model](#using-the-gopath-model), you can redefine the `GOPATH` environment variable to prevent existing packages in the current `GOPATH` directory from being changed.
87
+
88
+
### Build using make
89
+
72
90
Once inside the provider directory, you can run `make tools` to install the dependent tooling required to compile the provider.
73
91
74
92
At this point you can compile the provider by running `make build`, which will build the provider and put the provider binary in the `$GOPATH/bin` directory.
@@ -98,6 +116,56 @@ The majority of tests in the provider are Acceptance Tests - which provisions re
98
116
make testacc SERVICE='resource' TESTARGS='-run=TestAccAzureRMResourceGroup' TESTTIMEOUT='60m'
99
117
```
100
118
119
+
### Build using PowerShell scripts
120
+
121
+
If you like to develop on Windows, we provide a set of PowerShell scripts to build and test the provider.
122
+
They don't offer the luxury of a Makefile environment but are quite sufficient to develop on Windows.
123
+
124
+
#### `scripts\build.ps1`
125
+
126
+
The `build.ps1`is used to build the provider. Aside this the script runs (if not skipped) the defined unit tests and is able to install the compiled provider locally.
| -Fix | Fix any formatting rule deviations automatically. If the parameter is not set, the script runs in report mode. |
162
+
163
+
#### `scripts\lint-check-go.ps1`
164
+
165
+
Like with `gofmtcheck.ps1` the script validate if all `.go` files adhere to the required formatting rules and if any style mistakes exist. In difference to `gofmtcheck.ps1` the script uses Golint instead of Gofmt.
166
+
167
+
## Environment variables for acceptance tests
168
+
101
169
The following Environment Variables must be set in your shell prior to running acceptance tests:
0 commit comments