From 1caaac34859abc6689f089eb8ce93f4baff9fb77 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Fri, 28 Oct 2022 21:33:15 +0200 Subject: [PATCH] add drone yml --- .drone.yml | 11 ++++++ inventory/group_vars/drone | 17 +++++++-- inventory/group_vars/drone_vault | 30 +++++++++------- server/files/docker-compose-drone.yml | 51 +++++++++++++++++++++++++++ server/templates/env-drone.j2 | 8 +++++ 5 files changed, 102 insertions(+), 15 deletions(-) create mode 100644 .drone.yml create mode 100644 server/files/docker-compose-drone.yml create mode 100644 server/templates/env-drone.j2 diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..9fc7f77 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,11 @@ +kind: pipeline +name: default + +steps: +- name: check ansible syntax + image: plugins/ansible:3 + settings: + playbook: playbook.yml + galaxy: requirements.yml + inventory: inventory + syntax_check: true diff --git a/inventory/group_vars/drone b/inventory/group_vars/drone index 3d573ae..d63f0c5 100644 --- a/inventory/group_vars/drone +++ b/inventory/group_vars/drone @@ -1,9 +1,22 @@ drone_gitea_server: https://git.valczeryba.ovh -drone_server_host: drone.valczeryba.ovh +drone_server_host: drone.valczeryba.ovh:8000 drone_agents_enabled: true drone_server_proto: http drone_tls_autocert: false drone_open: false drone_host: http://localhost:8000 drone_rpc_server: drone-server:8000 -msg: drone \ No newline at end of file + +msg: drone + +project_src: "/home/valentin/drone" + +project_directory: + - "{{ project_src }}" + +project_env: env-drone.j2 +docker_compose_file: "docker-compose-drone.yml" + +ports_tcp: + - 8000 + - 9000 diff --git a/inventory/group_vars/drone_vault b/inventory/group_vars/drone_vault index 6ac6f69..95a82d0 100644 --- a/inventory/group_vars/drone_vault +++ b/inventory/group_vars/drone_vault @@ -1,14 +1,18 @@ $ANSIBLE_VAULT;1.1;AES256 -66626434383165353866386563396662333536643562623464653261666236396134393037363662 -3162326332336563633633363430306462623062626361300a366535646464333030626232383734 -37326534336662633532666264313235626638656363616362663361643235633662643832326562 -6365663364323562340a666563373038653137636565323139663530626535343430363663666133 -66383939656232653332343639633332626165343662633738333133353138666635303034646435 -65616364656433323734303232356131666333313333366332333964316563373464333533633066 -36326163346238353861313339623061643932333061373131333438666536383063343239373462 -31396164366132393764356334663866636433626464646431366633376164393065366230666436 -31636238313063613132343062656465386533326535356234356438613139616130336166303836 -65333061623331363230623530613738306530386139383937313033376331303938333566396334 -62656439373266393565303961623564306564386633383337626330636430653732373738366331 -64353339363461636364323361313831393865393935616334336636663963653861326130326461 -63633062373564376633663039393630643634306565613338646164613037373136 +33363236363632653263383164663339323738366635613164353231396462303361333135623330 +3564623639306161626331643662366339663465313132370a636136316366353434353035346138 +32393263626430326234626235666137306262666134656232316465626563633535373732643838 +3861303734656165630a646433623162393563303862393661303434356234643638303030646432 +33386130626163653965353732313164373239303366626433393566343638343362633234313339 +63323532613733353538303038663632623932366238343132356536396165636137633036313533 +62396134303862623733323639633134323838366164363937626138386265643465356464366565 +34303438383838656632383462366162663538353430646165643339383261643063373431383364 +38646239613465356337306636306639336164623761666165616663626635343130653230656162 +65396561343638366532313062363066663838346337356463316331336133336234653334613830 +66326337633038623036613430316662316432613962303337663430643531653665633264343564 +39383564633432643039306236613633643236646163353831346632653764633436336237346433 +33306136346235386465356630386333646366663037386230306261346161303938633032373361 +63306431306439373037343663616263373037386235303665643635336430346139653165636634 +63323634306333663030383431363437383966633461333432393636613863306134386162326664 +36376361343738653531623137326266663635633633323239633263383761616538656535343039 +6435 diff --git a/server/files/docker-compose-drone.yml b/server/files/docker-compose-drone.yml new file mode 100644 index 0000000..9887270 --- /dev/null +++ b/server/files/docker-compose-drone.yml @@ -0,0 +1,51 @@ +version: '3.5' + +services: + drone-server: + image: drone/drone:2 + ports: + - 8000:80 + - 9000:443 + networks: + - drone + volumes: + - ./drone-data:/var/lib/drone/ + - /var/run/docker.sock:/var/run/docker.sock + env_file: + - .env + restart: always + environment: + - DRONE_GITHUB_SKIP_VERIFY=true + - DRONE_AGENTS_ENABLED=true + - DRONE_SERVER_PROTO=http + - DRONE_TLS_AUTOCERT=false + - DRONE_OPEN=false + - DRONE_HOST=http://drone.valczeryba.ovh:8000 + - DRONE_GITHUB=true + # Variables below set via drone.env file + # - DRONE_USER_CREATE= + # - DRONE_USER_FILTER= + # - DRONE_GITHUB_CLIENT_ID= + # - DRONE_GITHUB_CLIENT_SECRET= + # - DRONE_RPC_SECRET= + + drone-agent: + image: drone/agent:1.2.1 + command: agent + restart: always + depends_on: + - drone-server + networks: + - drone + volumes: + - /var/run/docker.sock:/var/run/docker.sock + env_file: + - .env + environment: + - DRONE_RPC_SERVER=drone-server:8000 + # Variables below set via drone.env file + # - DRONE_RPC_SECRET= + +networks: + drone: + name: drone_network diff --git a/server/templates/env-drone.j2 b/server/templates/env-drone.j2 new file mode 100644 index 0000000..4d077b2 --- /dev/null +++ b/server/templates/env-drone.j2 @@ -0,0 +1,8 @@ +# Drone secret key, used for private communication between agents and web UI +DRONE_USER_CREATE= +DRONE_USER_FILTER= {{ drone_user_filter }} +DRONE_GITEA_SERVER={{ drone_gitea_server }} +DRONE_GITEA_CLIENT_ID={{ drone_gitea_client_id }} +DRONE_GITEA_CLIENT_SECRET={{ drone_gitea_client_secret }} +DRONE_RPC_SECRET={{ drone_rpc_secret }} +DRONE_SERVER_HOST={{ drone_server_host }}