From ea9148969a79f6af8b0b63ca914ddbb8f588792e Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 20 Jun 2019 23:39:54 +0800 Subject: [PATCH] feat(server): support kubernetes --- defaults/main.yml | 10 ++++++++++ templates/drone-server.env.j2 | 20 +++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index fe15c84..c8089d3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -45,3 +45,13 @@ drone_mysql_db: "drone" aws_default_region: "us-east-1" aws_region: "us-east-1" drone_s3_bucket: "" + +# Kubernetes +drone_kubernetes_enabled: False +drone_kubernetes_namespace: "" +drone_kubernetes_config_path: "" +drone_kubernetes_config_url: "" +drone_kubernetes_ttl_after_finished: "300" +drone_kubernetes_service_account: "" +drone_kubernetes_image_pull: "Always" +drone_kubernetes_image: "" diff --git a/templates/drone-server.env.j2 b/templates/drone-server.env.j2 index f8e2600..8eb50dc 100644 --- a/templates/drone-server.env.j2 +++ b/templates/drone-server.env.j2 @@ -53,9 +53,19 @@ DRONE_GITEA_SKIP_VERIFY={{ drone_gitea_skip_verify }} DRONE_GITEA_DEBUG={{ drone_github_debug }} {% endif %} {% if aws_access_key_id != "" and aws_secret_access_key != "" %} -aws_access_key_id={{ aws_access_key_id }} -aws_secret_access_key={{ aws_secret_access_key }} -aws_default_region={{ aws_default_region }} -aws_region={{ aws_region }} -drone_s3_bucket={{ drone_s3_bucket }} +AWS_ACCESS_KEY_ID={{ aws_access_key_id }} +AWS_SECRET_ACCESS_KEY={{ aws_secret_access_key }} +AWS_DEFAULT_REGION={{ aws_default_region }} +AWS_REGION={{ aws_region }} +DRONE_S3_BUCKET={{ drone_s3_bucket }} +{% endif %} +{% if drone_kubernetes_enabled == True %} +DRONE_KUBERNETES_ENABLED={{ aws_region }} +DRONE_KUBERNETES_NAMESPACE={{ aws_region }} +DRONE_KUBERNETES_CONFIG_PATH={{ aws_region }} +DRONE_KUBERNETES_CONFIG_URL={{ aws_region }} +DRONE_KUBERNETES_TTL_AFTER_FINISHED={{ aws_region }} +DRONE_KUBERNETES_SERVICE_ACCOUNT={{ aws_region }} +DRONE_KUBERNETES_IMAGE_PULL={{ aws_region }} +DRONE_KUBERNETES_IMAGE={{ aws_region }} {% endif %}