From 0c1e94323cc5fee79aa1d1aff2cd4fe1b9d3e39a Mon Sep 17 00:00:00 2001 From: Jesper Hess Nielsen Date: Sat, 2 Mar 2019 22:34:33 +0100 Subject: [PATCH] Add drone CI/CD pipeline --- playbook.yml | 1 + roles/docker/defaults/main.yml | 4 ++++ roles/docker/tasks/services/drone.yml | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 roles/docker/tasks/services/drone.yml diff --git a/playbook.yml b/playbook.yml index 7c82f5d..8b7f99a 100644 --- a/playbook.yml +++ b/playbook.yml @@ -21,6 +21,7 @@ - codimd - netdata - docker_registry + - drone - websites smtp_host: postfix diff --git a/roles/docker/defaults/main.yml b/roles/docker/defaults/main.yml index 74d66fa..75e3683 100644 --- a/roles/docker/defaults/main.yml +++ b/roles/docker/defaults/main.yml @@ -48,3 +48,7 @@ data_coop_website: cryptohagen_website: domain: "cryptohagen.dk" + +drone: + domain: "drone.{{ base_domain }}" + volume_folder: "{{ volume_root_folder }}/drone" diff --git a/roles/docker/tasks/services/drone.yml b/roles/docker/tasks/services/drone.yml new file mode 100644 index 0000000..ad05c46 --- /dev/null +++ b/roles/docker/tasks/services/drone.yml @@ -0,0 +1,21 @@ +--- +- name: Drone container + docker_container: + name: drone + image: drone/drone:latest + restart_policy: unless-stopped + networks: + - name: external_services + volumes: + - "{{ drone.volume_folder }}:/data" + - "/var/run/docker.sock:/var/run/docker.sock" + env: + DRONE_GITEA_SERVER: "https://{{ gitea.domain }}" + DRONE_GITEA_ALWAYS_AUTH: "False" + DRONE_RUNNER_CAPACITY: "2" + DRONE_SERVER_HOST: "{{ drone.domain }}" + DRONE_SERVER_PROTO: "https" + PLUGIN_CUSTOM_DNS: "91.239.100.100" + VIRTUAL_HOST: "{{ drone.domain }}" + LETSENCRYPT_HOST: "{{ drone.domain }}" + LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"