Skip to content
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

feature: support self hosted vcs #16

Merged
merged 4 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bootstrap/azuredevops/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variable "version_control_system_access_token" {
}

variable "version_control_system_organization" {
description = "The organization for the version control system to use for the deployment|3"
description = "The organization for the version control system to use for the deployment (supply a fqdn e.g. https://vcs.company.com/my-org to use a self-hosted Azure DevOps Server)|3"
type = string
}

Expand Down Expand Up @@ -45,7 +45,7 @@ variable "postfix_number" {
}

variable "azure_devops_use_organisation_legacy_url" {
description = "Use the legacy Azure DevOps URL (<organisation>.visualstudio.com) instead of the new URL (dev.azure.com/<organization>)|9|bool"
description = "Use the legacy Azure DevOps URL (<organisation>.visualstudio.com) instead of the new URL (dev.azure.com/<organization>). This is ignored if an fqdn is supplied for version_control_system_organization|9|bool"
type = bool
default = false
}
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/github/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variable "version_control_system_access_token" {
}

variable "version_control_system_organization" {
description = "The organization for the version control system to use for the deployment|3"
description = "The organization for the version control system to use for the deployment (supply a fqdn e.g. https://vcs.company.com/my-org to use a self-hosted GitHub Enterprise Server)|3"
type = string
}

Expand Down
2 changes: 1 addition & 1 deletion bootstrap/modules/azure_devops/locals.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
organization_url = var.use_legacy_organization_url ? "https://${var.organization_name}.visualstudio.com" : "https://dev.azure.com/${var.organization_name}"
organization_url = startswith(lower(var.organization_name), "https://") || startswith(lower(var.organization_name), "http://") ? var.organization_name : (var.use_legacy_organization_url ? "https://${var.organization_name}.visualstudio.com" : "https://dev.azure.com/${var.organization_name}")
}

locals {
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/modules/github/locals.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
organization_url = "https://github.com/${var.organization_name}"
organization_url = startswith(lower(var.organization_name), "https://") || startswith(lower(var.organization_name), "http://") ? var.organization_name : "https://github.com/${var.organization_name}"
}
6 changes: 3 additions & 3 deletions docs/wiki/[User-Guide]-Quick-Start-Phase-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ The inputs differ depending on the VCS you have chosen:
1. Fill out the following inputs:
1. `starter_module`: This is the choice of [Starter Modules][wiki_starter_modules], which is the baseline configuration you want for your Azure landing zone. This also determine the second set of input you'll be prompted for here.
1. `version_control_system_access_token`: Enter the Azure DevOps PAT you generated in a previous step.
1. `version_control_system_organization`: Enter the name of your Azure DevOps organization.
1. `version_control_system_organization`: Enter the name of your Azure DevOps organization. If you are using a self-hosted Azure DevOps Server, supply the fqdn, e.g. `https://vcs.company.com/my-org`.
1. `azure_location`: Enter the Azure region where you would like to deploy the storage account and identity for your continuous delivery pipeline. This field expects the `name` of the region, such as `uksouth`. You can find a full list of names by running `az account list-locations -o table`.
1. `azure_subscription_id`: Enter the id of the subscription in which you would like to deploy the storage account and identity for your continuous delivery pipeline. If left blank, the subscription you are connected to via `az login` will be used.
1. `service_name`: This is used to build up the names of your Azure and Azure DevOps resources, for example `rg-<service_name>-mgmt-uksouth-001`. We recommend using `alz` for this.
1. `environment_name`: This is used to build up the names of your Azure and Azure DevOps resources, for example `rg-alz-<environment_name>-uksouth-001`. We recommend using `mgmt` for this.
1. `postfix_number`: This is used to build up the names of your Azure and Azure DevOps resources, for example `rg-alz-mgmt-uksouth-<postfix_number>`. We recommend using `1` for this.
1. `azure_devops_use_organisation_legacy_url`: If you have not migrated to the modern url (still using `https://<organization_name>.visualstudio.com`) for your Azure DevOps organisation, then set this to `true`.
1. `azure_devops_use_organisation_legacy_url`: If you have not migrated to the modern url (still using `https://<organization_name>.visualstudio.com`) for your Azure DevOps organisation, then set this to `true`. This is ignored if you supply an fqdn to `version_control_system_organization`.
1. `azure_devops_create_project`: If you have an existing project you want to use rather than creating a new one, select `true`. We recommend creating a new project to ensure it is isolated by a strong security boundary.
1. `azure_devops_project_name`: Enter the name of the Azure DevOps project to create or the name of an existing poroject if you set `azure_devops_create_project` to `false`.
1. `azure_devops_authentication_scheme`: Enter the authentication scheme that your pipeline will use to authenticate to Azure. `WorkloadIdentityFederation` uses OpenId Connect and is the recommended approach. `ManagedServiceIdentity` requires the deployment of self-hosted agents are part of the bootstrap setup.
Expand All @@ -45,7 +45,7 @@ The inputs differ depending on the VCS you have chosen:
1. Fill out the following inputs:
1. `starter_module`: This is the choice of [Starter Module][wiki_starter_modules], which is the baseline configuration you want for your Azure landing zone. This also determine the second set of input you'll be prompted for here.
1. `version_control_system_access_token`: Enter the GitHub PAT you generated in a previous step.
1. `version_control_system_organization`: Enter the name of your GitHub organization.
1. `version_control_system_organization`: Enter the name of your GitHub organization. If you are using a self-hosted GitHub Enterprise Server, supply the fqdn, e.g. `https://vcs.company.com/my-org`.
1. `azure_location`: Enter the Azure region where you would like to deploy the storage account and identity for your continuous delivery pipeline. This field expects the `name` of the region, such as `uksouth`. You can find a full list of names by running `az account list-locations -o table`.
1. `azure_subscription_id`: Enter the id of the subscription in which you would like to deploy the storage account and identity for your continuous delivery pipeline. If left blank, the subscription you are connected to via `az login` will be used.
1. `service_name`: This is used to build up the names of your Azure and GitHub resources, for example `rg-<service_name>-mgmt-uksouth-001`. We recommend using `alz` for this.
Expand Down