# Terraform config for drone [![Build Status](https://drone.thomasklein.me/api/badges/thomasklein/terraform-app-drone/status.svg)](https://drone.thomasklein.me/thomasklein/terraform-app-drone) Drone is a self-hosted Continuous Integration platform. This terraform root module will create a Gitea OAuth2 application, a persistent volume for Drone and installs Drone to a Kubernetes namespace on Lawndale. **This module assumes Lawndale as the hosting environment!** ## Provider configurations The following providers are used and should be configured before calling `init` or `apply`. ### AWS AWS is only used for state backend. Check out [AWS Provider config](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#authentication-and-configuration). ### Gitea Either `GITEA_TOKEN` or `GITEA_USERNAME` and `GITEA_PASSWORD` must be set for authentication. ### Kubernetes / Helm Drone is provisioned with Helm on a kubernetes cluster. Helm is using the same environment variables as the Kubernetes provider. Set `KUBE_CONFIG_PATH` to use a kubeconfig file, and `KUBE_CTX` to use a different context than set in the kubeconfig. For token auth, set `KUBE_TOKEN` and `KUBE_HOST` environment vars. A PEM-encoded root certificates bundle for TLS authentication can be sourced by setting `KUBE_CLUSTER_CA_CERT_DATA`. Sources: [Kubernetes](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs#argument-reference) [Helm](https://registry.terraform.io/providers/hashicorp/helm/latest/docs) ## Persistent volume Persistence is supported by [terraform-modules//9p-persistent-volume](git.thomasklein.me/thomasklein/terraform-modules/9p-persistent-volume). ## Requirements The following requirements are needed by this module: - [aws](#requirement\_aws) (~> 4.9.0) - [gitea](#requirement\_gitea) (>= 0.1.0) - [helm](#requirement\_helm) (2.5.1) - [kubernetes](#requirement\_kubernetes) (2.11.0) ## Providers The following providers are used by this module: - [gitea](#provider\_gitea) (0.1.0) - [helm](#provider\_helm) (2.5.1) - [kubernetes](#provider\_kubernetes) (2.11.0) - [random](#provider\_random) (3.2.0) ## Modules The following Modules are called: ### [drone\_persistance](#module\_drone\_persistance) Source: git@git.thomasklein.me:thomasklein/terraform-modules//9p-persistent-volume Version: ## Resources The following resources are used by this module: - [gitea_oauth2_app.this](https://registry.terraform.io/providers/malarinv/gitea/latest/docs/resources/oauth2_app) (resource) - [helm_release.drone_runner_docker](https://registry.terraform.io/providers/hashicorp/helm/2.5.1/docs/resources/release) (resource) - [helm_release.drone_runner_kube](https://registry.terraform.io/providers/hashicorp/helm/2.5.1/docs/resources/release) (resource) - [helm_release.drone_server](https://registry.terraform.io/providers/hashicorp/helm/2.5.1/docs/resources/release) (resource) - [kubernetes_namespace.jobs](https://registry.terraform.io/providers/hashicorp/kubernetes/2.11.0/docs/resources/namespace) (resource) - [kubernetes_namespace.server](https://registry.terraform.io/providers/hashicorp/kubernetes/2.11.0/docs/resources/namespace) (resource) - [kubernetes_secret.runner_dashboard](https://registry.terraform.io/providers/hashicorp/kubernetes/2.11.0/docs/resources/secret) (resource) - [random_password.drone_rpc_secret](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) (resource) - [random_password.runner_dashboard](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) (resource) ## Required Inputs No required inputs. ## Optional Inputs No optional inputs. ## Outputs No outputs.