From 8122f3389a6dc81d4dd8605920e09d85a3f1eaed Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 11 Jan 2019 21:27:47 +0100 Subject: [PATCH] migrate to drone 1.0.0 --- defaults/main.yml | 11 +++----- templates/services/droneci-compose.yml.j2 | 32 +++++++++-------------- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index ca86e6d..fec7691 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,5 @@ --- -droneci_version: 0.8 +droneci_version: 1.0.0-rc.3 droneci_service_directory: /var/lib/docker/services/drone-ci droneci_docker_socket_path: /var/run/docker.sock droneci_host: http://localhost @@ -15,6 +15,7 @@ droneci_server_exposed_ip: 127.0.0.1 droneci_agent_image: "drone/agent:{{ droneci_version }}" droneci_agent_restart_policy: always +dronevi_agent_capacity: 2 # droneci_agent_memory_limit: 512m # defaults to not set # droneci_agent_memory_reservation: 256m # defaults to not set @@ -54,10 +55,7 @@ droneci_postgres_user: state: present droneci_gitea_enabled: False -droneci_gitea_host: http://my-git.example.com -# droneci_gitea_git_user: # default not set -# droneci_gitea_git_password: # default not set -droneci_gitea_private_mode_enabled: False +droneci_gitea_server: http://my-git.example.com droneci_gitea_skip_verify_enabled: False droneci_tls_cert_path: droneci.pem @@ -79,9 +77,6 @@ droneci_server_http_port: 8080 droneci_server_proxy_port: "{{ droneci_server_http_port }}" droneci_server_proxy_protocol: http -droneci_pass_ca_enabled: False -droneci_ca_path: /etc/pki/tls/certs/ca-bundle.crt - # droneci_admins: # defaults to not set # droneci_http_proxy: # defaults to not set # droneci_https_proxy: # defaults to not set diff --git a/templates/services/droneci-compose.yml.j2 b/templates/services/droneci-compose.yml.j2 index 74d3b8e..79239fc 100644 --- a/templates/services/droneci-compose.yml.j2 +++ b/templates/services/droneci-compose.yml.j2 @@ -7,8 +7,7 @@ services: image: {{ droneci_server_image }} ports: - - {{ droneci_server_exposed_ip + ':' if droneci_server_exposed_ip is defined else '' }}{{ droneci_server_exposed_port }}:8000 - - 9000 + - {{ droneci_server_exposed_ip + ':' if droneci_server_exposed_ip is defined else '' }}{{ droneci_server_exposed_port }}:80 {% if not droneci_postgres_enabled %} volumes: - droneserver-data:/var/lib/drone/ @@ -21,27 +20,19 @@ services: {% endif %} restart: {{ droneci_server_restart_policy }} environment: - - DRONE_OPEN=true - - DRONE_HOST={{ droneci_host }} - - DRONE_SECRET={{ droneci_secret }} - - DRONE_ADMIN={{ droneci_admins | default(omit) | join(",") }} - {% if droneci_pass_ca_enabled %} - - DRONE_VOLUME={{ droneci_ca_path }}:/etc/ssl/certs/ca-certificates.crt - {% endif %} + - DRONE_SERVER_HOST={{ droneci_host | urlsplit('hostname') }} + - DRONE_SERVER_PROTO={{ droneci_host | urlsplit('scheme') }} + - DRONE_RPC_SECRET={{ droneci_secret }} + - DRONE_USER_CREATE={{ droneci_admins | default(omit) | join(",") }} + - DRONE_LOGS_COLOR=true + - DRONE_LOGS_PRETTY=true + - DRONE_TLS_AUTOCERT=false {% if droneci_postgres_enabled %} - DRONE_DATABASE_DRIVER=postgres - DRONE_DATABASE_DATASOURCE=postgres://{{ droneci_postgres_user.name }}:{{ droneci_postgres_user.password }}@{{ droneci_postgres_server }}/{{ droneci_postgres_db.name }}?sslmode={{ droneci_postgres_ssl_mode }} {% endif %} {% if droneci_gitea_enabled %} - - DRONE_GITEA=true - - DRONE_GITEA_URL={{ droneci_gitea_host }} - {% if droneci_gitea_git_user is defined %} - - DRONE_GITEA_GIT_USERNAME={{ droneci_gitea_git_user }} - {% endif %} - {% if droneci_gitea_git_password is defined %} - - DRONE_GITEA_GIT_PASSWORD={{ droneci_gitea_git_password }} - {% endif %} - - DRONE_GITEA_PRIVATE_MODE={{ droneci_gitea_private_mode_enabled | lower }} + - DRONE_GITEA_SERVER={{ droneci_gitea_server }} - DRONE_GITEA_SKIP_VERIFY={{ droneci_gitea_skip_verify_enabled | lower }} {% endif %} {% if droneci_http_proxy is defined %} @@ -71,8 +62,9 @@ services: volumes: - {{ droneci_docker_socket_path }}:/var/run/docker.sock environment: - - DRONE_SERVER=droneserver:9000 - - DRONE_SECRET={{ droneci_secret }} + - DRONE_RPC_SERVER=http://droneserver + - DRONE_RPC_SECRET={{ droneci_secret }} + - DRONE_RUNNER_CAPACITY={{ dronevi_agent_capacity }} # TODO: temp static value, needs to be replaced by a custom fact - DOCKER_API_VERSION=1.26 {% if droneci_agent_memory_limit is defined %}