This commit is contained in:
2023-11-25 19:58:18 -06:00
parent 1b7a0fb045
commit 6a4c19b314
4 changed files with 20 additions and 5 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.terraform* .terraform*
.env .env
*.tfstate*

View File

@@ -1,5 +1,5 @@
terraform { terraform {
backend "http" {} #backend "http" {}
required_providers { required_providers {
gitlab = { gitlab = {
source = "gitlabhq/gitlab" source = "gitlabhq/gitlab"
@@ -41,11 +41,13 @@ resource "gitlab_branch_protection" "release" {
} }
resource "gitlab_project_runner_enablement" "k3s" { resource "gitlab_project_runner_enablement" "k3s" {
count = var.GITLAB_SHARED_RUNNER_ID != 0 ? 1 : 0
project = gitlab_project.project.id project = gitlab_project.project.id
runner_id = var.GITLAB_SHARED_RUNNER_ID runner_id = var.GITLAB_SHARED_RUNNER_ID
} }
resource "gitlab_project_variable" "OCTOAPI" { resource "gitlab_project_variable" "OCTOAPI" {
count = var.OCTOAPI != "" ? 1 : 0
project = gitlab_project.project.id project = gitlab_project.project.id
key = "OCTOAPI" key = "OCTOAPI"
value = var.OCTOAPI value = var.OCTOAPI

View File

@@ -2,18 +2,17 @@ variable "GITLAB_TOKEN" {
type = string type = string
} }
variable "GITLAB_PROJECT_ID" {
type = number
}
variable "GITLAB_PROJECT_NAME" { variable "GITLAB_PROJECT_NAME" {
type = string type = string
} }
variable "GITLAB_SHARED_RUNNER_ID" { variable "GITLAB_SHARED_RUNNER_ID" {
type = number type = number
default = 0
} }
variable "OCTOAPI" { variable "OCTOAPI" {
type = string type = string
default = ""
} }

View File

@@ -0,0 +1,13 @@
terraform {
required_providers {
octopusdeploy = {
source = "OctopusDeployLabs/octopusdeploy"
version = "0.13.3"
}
}
}
provider "octopusdeploy" {
# Configuration options
}