For complex projects that may require a migration over a protracted period we recommend utilizing Terraform to
simplify the process of quickly switching back should a problem arise to avoid disruption.
The following demonstrates manging a variety of group variables,
as described in the other migration documentation, in combination with our enhanced runner
module.
To switch between runners simply toggle the value of local.cedari
and apply the configuration.
locals {
cedarci = true
variables = local.cedarci ? {
CEDARCI = "true"
COMPLEX_CONFIG = "value2"
TAG_LARGE = "cedarci"
TAG_SMALL = "cedarci"
} : {
COMPLEX_CONFIG = "value1"
TAG_LARGE = "saas-linux-large-amd64"
TAG_SMALL = "saas-linux-small-amd64"
}
}
data "gitlab_group" "default" {
full_path = "path/to/group"
}
resource "gitlab_group_variable" "variables" {
for_each = local.variables
group = data.gitlab_group.default.id
key = each.key
value = each.value
}
module "cedarci" {
source = "git::git@gitlab.com:cedarci/integration/terraform_cedarci.git?ref=main"
config_user = "speedy"
gitlab_group = data.gitlab_group.default.full_path
}