forked from hashicorp/terraform-provider-azurerm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from terraform-providers/master
sync
- Loading branch information
Showing
8,321 changed files
with
2,030,708 additions
and
611,493 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
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 @@ | ||
blank_issues_enabled: false |
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 @@ | ||
1.14.2 |
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,39 @@ | ||
run: | ||
deadline: 60m10s | ||
modules-download-mode: vendor | ||
|
||
issues: | ||
max-per-linter: 0 | ||
max-same-issues: 0 | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- errcheck | ||
- gocritic | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
- nakedret | ||
- misspell | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- varcheck | ||
- vet | ||
- vetshadow | ||
- whitespace | ||
|
||
linters-settings: | ||
errcheck: | ||
ignore: github.com/hashicorp/terraform-plugin-sdk/helper/schema:ForceNew|Set,fmt:.*,io:Close | ||
misspell: | ||
ignore-words: | ||
- hdinsight | ||
- exportfs |
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,40 @@ | ||
run: | ||
deadline: 10m10s | ||
modules-download-mode: vendor | ||
|
||
issues: | ||
max-per-linter: 0 | ||
max-same-issues: 0 | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- errcheck | ||
- gocritic | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
- nakedret | ||
- misspell | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unused | ||
- unconvert | ||
- unparam | ||
- varcheck | ||
- vet | ||
- vetshadow | ||
- whitespace | ||
|
||
linters-settings: | ||
errcheck: | ||
ignore: github.com/hashicorp/terraform-plugin-sdk/helper/schema:ForceNew|Set,fmt:.*,io:Close | ||
misspell: | ||
ignore-words: | ||
- hdinsight | ||
- exportfs |
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 @@ | ||
queued_behavior "release_commenter" "releases" { | ||
repo_prefix = "terraform-provider-" | ||
|
||
message = <<-EOF | ||
This has been released in [version ${var.release_version} of the provider](${var.changelog_link}). Please see the [Terraform documentation on provider versioning](https://www.terraform.io/docs/configuration/providers.html#provider-versions) or reach out if you need any assistance upgrading. As an example: | ||
```hcl | ||
provider "${var.project_name}" { | ||
version = "~> ${var.release_version}" | ||
} | ||
# ... other configuration ... | ||
``` | ||
EOF | ||
} | ||
|
||
poll "closed_issue_locker" "locker" { | ||
schedule = "0 50 14 * * *" | ||
closed_for = "720h" # 30 days | ||
max_issues = 500 | ||
sleep_between_issues = "5s" | ||
|
||
message = <<-EOF | ||
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. | ||
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! | ||
EOF | ||
} |
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,2 @@ | ||
target/ | ||
*.iml |
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,10 @@ | ||
default: tools | ||
|
||
tools: | ||
mvn -U dependency:sources | ||
|
||
test: validate | ||
mvn test -DtestPackage=tests | ||
|
||
validate: | ||
mvn teamcity-configs:generate |
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,28 @@ | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.ParametrizedWithType | ||
|
||
class ClientConfiguration(var clientId: String, | ||
var clientSecret: String, | ||
val subscriptionId : String, | ||
val tenantId : String, | ||
val clientIdAlt: String, | ||
val clientSecretAlt: String, | ||
val subscriptionIdAlt : String) { | ||
} | ||
|
||
class LocationConfiguration(var primary : String, var secondary : String, var ternary : String, var rotate : Boolean) { | ||
} | ||
|
||
fun ParametrizedWithType.ConfigureAzureSpecificTestParameters(environment: String, config: ClientConfiguration, locationsForEnv: LocationConfiguration) { | ||
hiddenPasswordVariable("env.ARM_CLIENT_ID", config.clientId, "The ID of the Service Principal used for Testing") | ||
hiddenPasswordVariable("env.ARM_CLIENT_ID_ALT", config.clientIdAlt, "The ID of the Alternate Service Principal used for Testing") | ||
hiddenPasswordVariable("env.ARM_CLIENT_SECRET", config.clientSecret, "The Client Secret of the Service Principal used for Testing") | ||
hiddenPasswordVariable("env.ARM_CLIENT_SECRET_ALT", config.clientSecretAlt, "The Client Secret of the Alternate Service Principal used for Testing") | ||
hiddenVariable("env.ARM_ENVIRONMENT", environment, "The Azure Environment in which the tests are running") | ||
hiddenVariable("env.ARM_PROVIDER_DYNAMIC_TEST", "%b".format(locationsForEnv.rotate), "Should tests rotate between the supported regions?") | ||
hiddenPasswordVariable("env.ARM_SUBSCRIPTION_ID", config.subscriptionId, "The ID of the Azure Subscription used for Testing") | ||
hiddenPasswordVariable("env.ARM_SUBSCRIPTION_ID_ALT", config.subscriptionIdAlt, "The ID of the Alternate Azure Subscription used for Testing") | ||
hiddenPasswordVariable("env.ARM_TENANT_ID", config.tenantId, "The ID of the Azure Tenant used for Testing") | ||
hiddenVariable("env.ARM_TEST_LOCATION", locationsForEnv.primary, "The Primary region which should be used for testing") | ||
hiddenVariable("env.ARM_TEST_LOCATION_ALT", locationsForEnv.secondary, "The Primary region which should be used for testing") | ||
hiddenVariable("env.ARM_TEST_LOCATION_ALT2", locationsForEnv.ternary, "The Primary region which should be used for testing") | ||
} |
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,108 @@ | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.* | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.GolangFeature | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.ScriptBuildStep | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.schedule | ||
|
||
// NOTE: in time this could be pulled out into a separate Kotlin package | ||
|
||
// unfortunately TeamCity's Go Test Json parser appears to be broken | ||
// as such for the moment let's use the old method with a feature-flag | ||
const val useTeamCityGoTest = false | ||
|
||
fun BuildFeatures.Golang() { | ||
if (useTeamCityGoTest) { | ||
feature(GolangFeature { | ||
testFormat = "json" | ||
}) | ||
} | ||
} | ||
|
||
fun BuildSteps.ConfigureGoEnv() { | ||
step(ScriptBuildStep { | ||
name = "Configure Go Version" | ||
scriptContent = "goenv install -s \$(goenv local) && goenv rehash" | ||
}) | ||
} | ||
|
||
fun BuildSteps.RunAcceptanceTests(providerName : String, packageName: String) { | ||
var servicePath = "./%s/internal/services/%s/tests".format(providerName, packageName) | ||
|
||
if (useTeamCityGoTest) { | ||
step(ScriptBuildStep { | ||
name = "Run Tests" | ||
scriptContent = "go test -v \"$servicePath\" -timeout=\"%TIMEOUT%h\" -test.parallel=\"%PARALLELISM%\" -run=\"%TEST_PREFIX%\" -json" | ||
}) | ||
} else { | ||
step(ScriptBuildStep { | ||
name = "Compile Test Binary" | ||
scriptContent = "go test -c -o test-binary" | ||
workingDir = servicePath | ||
}) | ||
|
||
step(ScriptBuildStep { | ||
// ./test-binary -test.list=TestAccAzureRMResourceGroup_ | teamcity-go-test -test ./test-binary -timeout 1s | ||
name = "Run via jen20/teamcity-go-test" | ||
scriptContent = "./test-binary -test.list=\"%TEST_PREFIX%\" | teamcity-go-test -test ./test-binary -parallelism \"%PARALLELISM%\" -timeout \"%TIMEOUT%h\"" | ||
workingDir = servicePath | ||
}) | ||
} | ||
} | ||
|
||
fun BuildSteps.RunAcceptanceTestsForPullRequest(providerName : String, packageName: String) { | ||
var servicePath = "./%s/internal/services/%s/...".format(providerName, packageName) | ||
if (useTeamCityGoTest) { | ||
step(ScriptBuildStep { | ||
name = "Run Tests" | ||
scriptContent = "go test -v \"$servicePath\" -timeout=\"%TIMEOUT%h\" -test.parallel=\"%PARALLELISM%\" -run=\"%TEST_PREFIX%\" -json" | ||
}) | ||
} else { | ||
// Building a binary with teamcity-go-test doesn't work for multiple packages, so fallback to this | ||
step(ScriptBuildStep { | ||
name = "Install tombuildsstuff/teamcity-go-test-json" | ||
scriptContent = "wget https://github.com/tombuildsstuff/teamcity-go-test-json/releases/download/v0.2.0/teamcity-go-test-json_linux_amd64 && chmod +x teamcity-go-test-json_linux_amd64" | ||
}) | ||
|
||
step(ScriptBuildStep { | ||
name = "Run Tests" | ||
scriptContent = "GOFLAGS=\"-mod=vendor\" ./teamcity-go-test-json_linux_amd64 -scope \"$servicePath\" -prefix \"%TEST_PREFIX%\" -count=1 -parallelism=%PARALLELISM% -timeout %TIMEOUT%" | ||
}) | ||
} | ||
} | ||
|
||
fun ParametrizedWithType.TerraformAcceptanceTestParameters(parallelism : Int, prefix : String, timeout: String) { | ||
text("PARALLELISM", "%d".format(parallelism)) | ||
text("TEST_PREFIX", prefix) | ||
text("TIMEOUT", timeout) | ||
} | ||
|
||
fun ParametrizedWithType.ReadOnlySettings() { | ||
hiddenVariable("teamcity.ui.settings.readOnly", "true", "Requires build configurations be edited via Kotlin") | ||
} | ||
|
||
fun ParametrizedWithType.TerraformAcceptanceTestsFlag() { | ||
hiddenVariable("env.TF_ACC", "1", "Set to a value to run the Acceptance Tests") | ||
} | ||
|
||
fun ParametrizedWithType.TerraformShouldPanicForSchemaErrors() { | ||
hiddenVariable("env.TF_SCHEMA_PANIC_ON_ERROR", "1", "Panic if unknown/unmatched fields are set into the state") | ||
} | ||
|
||
fun ParametrizedWithType.hiddenVariable(name: String, value: String, description: String) { | ||
text(name, value, "", description, ParameterDisplay.HIDDEN) | ||
} | ||
|
||
fun ParametrizedWithType.hiddenPasswordVariable(name: String, value: String, description: String) { | ||
password(name, value, "", description, ParameterDisplay.HIDDEN) | ||
} | ||
|
||
fun Triggers.RunNightly(nightlyTestsEnabled: Boolean, startHour: Int) { | ||
schedule{ | ||
enabled = nightlyTestsEnabled | ||
branchFilter = "+:refs/heads/master" | ||
|
||
schedulingPolicy = daily { | ||
hour = startHour | ||
timezone = "SERVER" | ||
} | ||
} | ||
} |
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,48 @@ | ||
import jetbrains.buildServer.configs.kotlin.v2019_2.* | ||
|
||
class pullRequest(displayName: String, environment: String) { | ||
val displayName = displayName | ||
val environment = environment | ||
|
||
fun buildConfiguration(providerName : String) : BuildType { | ||
return BuildType { | ||
// TC needs a consistent ID for dynamically generated packages | ||
id(uniqueID(providerName)) | ||
|
||
name = displayName | ||
|
||
vcs { | ||
root(providerRepository) | ||
cleanCheckout = true | ||
} | ||
|
||
steps { | ||
var packageName = "\"%SERVICES%\"" | ||
|
||
ConfigureGoEnv() | ||
RunAcceptanceTestsForPullRequest(providerName, packageName) | ||
} | ||
|
||
failureConditions { | ||
errorMessage = true | ||
} | ||
|
||
features { | ||
Golang() | ||
} | ||
|
||
params { | ||
TerraformAcceptanceTestParameters(defaultParallelism, "TestAcc", "12") | ||
TerraformAcceptanceTestsFlag() | ||
TerraformShouldPanicForSchemaErrors() | ||
ReadOnlySettings() | ||
|
||
text("SERVICES", "portal") | ||
} | ||
} | ||
} | ||
|
||
fun uniqueID(provider : String) : String { | ||
return "%s_PR_%s".format(provider.toUpperCase(), environment.toUpperCase()) | ||
} | ||
} |
Oops, something went wrong.