Skip to content

Drone

Auto Documentation

Documentation Generated with Python on 2021-04-03

Default Variables

Tasks

main.yml

- include: drone.yml
- include: runner.yml

runner.yml

- name: Create Drone Runner
  docker_container:
    name: drone-runner
    image: "drone/drone-runner-docker:1"
    restart_policy: unless-stopped
    ports:
      - "3000:3000"
    networks:
      - name: web
    env:
      DRONE_RPC_HOST: "drone:80"
      DRONE_RPC_SECRET: "{{ drone_rpc_secret }}"
      DRONE_RUNNER_NAME: drone-runner
      DRONE_RPC_PROTO: http
      DRONE_RUNNER_CAPACITY: "2"
    state: started
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

drone.yml

- name: Create Drone Directory
  file:
    path: "{{ docker_dir }}/drone"
    state: directory
  tags: drone

- name: Create Drone Docker Container
  docker_container:
    name: drone
    image: "drone/drone:1.10.1"
    user: root
    privileged: yes
    restart_policy: unless-stopped
    networks:
      - name: web
    env:
      DRONE_GITEA_SERVER: "https://{{ proxy.gitea.subdomain }}.{{ primary_domain }}"
      DRONE_GITEA_CLIENT_ID: "{{ gitea_drone_id }}"
      DRONE_GITEA_CLIENT_SECRET: "{{ gitea_drone_secret }}"
      DRONE_SERVER_HOST: "{{ proxy.drone.subdomain }}.{{ primary_domain }}"
      DRONE_USER_CREATE: "username:admin,admin:true"
      DRONE_SERVER_PORT: ":{{ proxy.drone.port }}"
      DRONE_SERVER_PROTO: "https"
      DRONE_RPC_SECRET: "{{ drone_rpc_secret }}"
      DRONE_LOGS_DEBUG: "true"
      DRONE_GIT_ALWAYS_AUTH: "true"
    state: started
    volumes:
      - "{{ docker_dir }}/drone:/data"
      - /var/run/docker.sock:/var/run/docker.sock