cloud-native-toolkit / terraform-tools-gitops

Module to create a GitOps repository
6 stars 6 forks source link

Can you please provide more details for expected format for following variables? #85

Closed thomassuedbroecker closed 2 years ago

thomassuedbroecker commented 2 years ago

@seansund

variables.tf file

variable "project" {
  type        = string
  description = "The project that will be used for the git repo. (Primarily used for Azure DevOps repos)"
  default     = ""
}
variable "host" {
  type        = string
  description = "The host for the git repository. The git host used can be a GitHub, GitHub Enterprise, Gitlab, Bitbucket, Gitea or Azure DevOps server. If the host is null assumes in-cluster Gitea instance will be used."
  default     = ""
}
variable "server_name" {
  type        = string
  description = "The name of the cluster that will be configured via gitops. This is used to separate the config by cluster"
  default     = "default"
}

FYI: It seems it is the full name without the protocol github.com/[ORG]/[PROJECT] and not the short name, when I look into the bash automation export REPO_URL="https://${REPO}" right?

variable "repo" {
  type        = string
  description = "The short name of the repository (i.e. the part after the org/group name)"
}
timroster commented 2 years ago

@thomassuedbroecker HTH -

project - this is an Azure devops project name https://docs.microsoft.com/en-us/azure/devops/organizations/projects/about-projects?view=azure-devops , but I've not seen a fully defined bom for this module for Azure ... myproject1, foo-bar

host - fqdn of git server, e.g. github.com, gitlab.com, etc.

server_name - used in the gitops repo to differentiate between clusters. Can be anything as long as it's consistent I believe. Most of the automation solutions with quickstarts and a single cluster leave this as untouched so default gets used in the repo

the simple string variables host, org|username and repo define a git repo destination as (except azure devops that inserts the project after the organization IIRC):

https://${HOST}/${ORG}/${REPO} except when org is empty then following github semantics where the username defines the default organization it's https://${HOST}/${USERNAME}/${REPO}

Personally, I have a dedicated organization in my public github that I only use for gitops repos and keep my default one for working on open source projects.

thomassuedbroecker commented 2 years ago

@timroster Thanks, I figured out most of those too, but they should be documented more clearly to avoid queries. Maybe just reuse your answers. ;-)