generated from masterpointio/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 3
feat: enable integration with ADO #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
54593ae
feat: enable integration with ADO
westonplatter 321c75c
fix: id now is optiional and matchs the variable declaration
westonplatter 05f4707
fix: also allow the github_enterprise.id to be null to match variable…
westonplatter 7b424de
feat: also enable raw_git
westonplatter c1669e5
Update examples/azure-devops/main.tf
westonplatter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,22 @@ | ||
| # Azure DevOps Integration Example | ||
|
|
||
| This example demonstrates how to configure the spacelift-automation module with Azure DevOps as the version control system. | ||
|
|
||
| See Spacelift's full walk through here, https://docs.spacelift.io/integrations/source-control/azure-devops | ||
|
|
||
| ## Configuration | ||
|
|
||
| The key difference from GitHub integration is using the `azure_devops` block instead of `github_enterprise`: | ||
|
|
||
| ```hcl | ||
| azure_devops = { | ||
| project = "MyProject" # Your Azure DevOps project name | ||
| id = "integration-id" # Spacelift Azure DevOps integration ID | ||
| } | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| 1. Update the `azure_devops.project` and `azure_devops.id` values with your Azure DevOps project and Spacelift integration ID | ||
| 2. Update the `repository` value with your actual repository name | ||
| 3. Run `terraform init` and `terraform plan` to see what resources will be created |
This file contains hidden or 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 @@ | ||
| module "automation_azure_devops" { | ||
| source = "../../" | ||
|
|
||
| azure_devops = { | ||
| project = "MyProject-Spacelift-Project" | ||
| id = "name-of-your-azure-devops-integration-in-spacelift" | ||
| } | ||
| repository = "MyProject-Spacelift-Project" | ||
| branch = "main" | ||
|
|
||
| root_modules_path = "../../examples/complete/root-modules" | ||
| all_root_modules_enabled = true | ||
|
|
||
| aws_integration_id = "01JEC7ZACVKHTSVY4NF8QNZVVB" | ||
| aws_integration_enabled = true | ||
| } | ||
|
|
||
| module "spacelift_policies" { | ||
| source = "masterpointio/spacelift/policies" | ||
| version = "0.2.0" | ||
|
|
||
| policies = { | ||
| "access-default" = { | ||
| body = <<-EOT | ||
| package spacelift | ||
| default allow = true | ||
| EOT | ||
| type = "ACCESS" | ||
| description = "Policy allowing access to resources" | ||
| labels = ["team:sre", "env:dev"] | ||
| } | ||
|
|
||
| trigger-administrative = { | ||
| body_url = "https://raw.githubusercontent.com/cloudposse/terraform-spacelift-cloud-infrastructure-automation/1.6.0/catalog/policies/trigger.administrative.rego" | ||
| type = "TRIGGER" | ||
| labels = ["autoattach:*"] # Showcasing how to attach to ALL stacks | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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 @@ | ||
| terraform { | ||
| required_version = ">= 1.9" | ||
|
|
||
| required_providers { | ||
| spacelift = { | ||
| source = "spacelift-io/spacelift" | ||
| version = ">= 1.14" | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -36,6 +36,15 @@ variable "github_enterprise" { | |
| default = null | ||
| } | ||
|
|
||
| variable "azure_devops" { | ||
| type = object({ | ||
| project = string | ||
| id = optional(string) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the ID is left off, does anything work?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If |
||
| }) | ||
| description = "The Azure DevOps integration settings" | ||
| default = null | ||
| } | ||
|
|
||
| variable "repository" { | ||
| type = string | ||
| description = "The name of your infrastructure repo" | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.