Compare commits
46 Commits
2e3d7a7a84
...
master
Author | SHA1 | Date | |
---|---|---|---|
f7622d10a6 | |||
f36366a319 | |||
e502e04372 | |||
67c2a0ed3e | |||
2a63aed0e3 | |||
452a650b16 | |||
3a16d3e723 | |||
369aed9ea1 | |||
11d0273ac1 | |||
4eee20f63f | |||
8008b025d0 | |||
572be625bd | |||
005127a37b | |||
097d0621d6 | |||
398adda930 | |||
371ee06a41 | |||
27fcb8b6ec | |||
653891f446 | |||
87db6ddf40 | |||
c9a0e48346 | |||
284e86c424 | |||
1caaac3485 | |||
372f1d7c18 | |||
c26a6c6f84 | |||
e4ee762c65 | |||
91d441b38e | |||
42f2a14d87 | |||
93eca7fec9 | |||
541eda55f6 | |||
e6f9d71c4f | |||
da8e10ef4e | |||
ac3fecbaca | |||
db8491f577 | |||
44dce58617 | |||
9799d9c39c | |||
234e9b6395 | |||
28f46dc9f0 | |||
5e40ed2cc9 | |||
4af016b0c4 | |||
30d3b2bfee | |||
a30ab86b4f | |||
bbb3e03651 | |||
b9c54eff60 | |||
a9c26d97bb | |||
ad5dbdc914 | |||
29a040751a |
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Dockerfile
|
19
.drone.yml
Normal file
19
.drone.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
type: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: deploy
|
||||||
|
image: v4l3n71n/covas:latest
|
||||||
|
pull: if-not-exists
|
||||||
|
commands:
|
||||||
|
- eval $(ssh-agent -s)
|
||||||
|
- id -u ansible
|
||||||
|
- sshpass -p 50ford5080850 ssh-add ssh_keys/id_rsa_nas
|
||||||
|
- sshpass -p 23v4l3n71n02cz3ry841993 ssh-add ssh_keys/id_rsa_vps
|
||||||
|
- ansible-playbook -i inventory --syntax-check playbook.yml
|
||||||
|
- ansible --ask-vault-password -i inventory -m ping playbook.yml
|
||||||
|
|
||||||
|
|
||||||
|
image_pull_secrets:
|
||||||
|
- dockerconfig
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ssh_keys/
|
9
Dockerfile
Normal file
9
Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
FROM debian:bookworm-slim
|
||||||
|
RUN apt-get update --yes && apt-get upgrade --yes && apt-get install --yes python3 python3-pip openssh-client sshpass && rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN groupadd -r ansible && useradd -m -r -g ansible ansible
|
||||||
|
USER ansible
|
||||||
|
RUN pip install ansible
|
||||||
|
WORKDIR /home/ansible
|
||||||
|
ENV PATH="${PATH}:/home/ansible/.local/bin"
|
||||||
|
COPY --chown=ansible:ansible . /home/ansible
|
||||||
|
RUN ansible-galaxy install -vvvv -r requirements.yml
|
@@ -1,3 +1,4 @@
|
|||||||
|
msg: db
|
||||||
postgres_url: db.valczeryba.ovh
|
postgres_url: db.valczeryba.ovh
|
||||||
postgres_db: toto
|
postgres_db: toto
|
||||||
postgres_port: 54321
|
postgres_port: 54321
|
||||||
@@ -10,13 +11,17 @@ project_directory:
|
|||||||
- "{{ project_src }}"
|
- "{{ project_src }}"
|
||||||
- "{{ project_src }}/{{ project_name }}"
|
- "{{ project_src }}/{{ project_name }}"
|
||||||
|
|
||||||
docker_compose_file: "docker-compose-db.yml"
|
docker_compose_file: "docker-compose-db.yml.j2"
|
||||||
|
|
||||||
project_env: "env-db.j2"
|
project_env: "env-db.j2"
|
||||||
|
|
||||||
redis_url: redis.valczeryba.ovh
|
redis_url: redis.valczeryba.ovh
|
||||||
redis_port: 63791
|
redis_port: 63791
|
||||||
|
|
||||||
|
mongo_port: 28017
|
||||||
ports_tcp:
|
ports_tcp:
|
||||||
- "{{ postgres_port }}"
|
- "{{ postgres_port }}"
|
||||||
- "{{ redis_port }}"
|
- "{{ redis_port }}"
|
||||||
|
- "{{ mongo_port }}"
|
||||||
|
|
||||||
|
covas_liquibase: false
|
@@ -1,15 +1,17 @@
|
|||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
37393861643630616231613561636565313733336436343662643761656365363463326230313338
|
64653663303437333433396331636461353737313832366539353264623561393761666464316363
|
||||||
6566616439343464623432363535323064653934666432330a613866663331633433353531366639
|
3633613637663530383739353830366662646461653138650a663939373238663737363737353535
|
||||||
33653332316333646535343063373334316139663262643637373862306131613032306336633132
|
65313433373565343830396230656162663361366265363131323961353764333462386464376239
|
||||||
3232633963363664330a343932666431366665613239663066326537333862666332333465313966
|
3662656464633566310a616331653331383631343065396537333338353738353865636539396533
|
||||||
63663364633965333737366535646131656437323539613631623239326233343232613334303339
|
63333436663739346231626139316265643438393739383761383033616465613964643830643033
|
||||||
39646633373830336236666338313536623137313064643332336436636538636666333135393638
|
66336237303833616638636336393739326332623738393032646561376564343835353533366632
|
||||||
39393133306133383739313662353262646365383134393035346337643933363630643963316136
|
64633239656639303063653538396562393366396137316530633638333539333631343238376463
|
||||||
66346332313732396166313131666239613932336366373161396364653062633061653865393635
|
62366463393234663834616639633635303537633565636634383435363663336363386238646563
|
||||||
30616362323439663933333230653066386562336638653037653637383536383139343130336166
|
32633634323332393765343933313666333134346132636637383233633064383663323531333834
|
||||||
30346665613363383065333536356664393233393734343566616332636164623037623161393533
|
61366334633532653430326266623366353761626330386439626437623266316636633235326263
|
||||||
33666463393532663565313062666631366132653832333961336331313965393732633134316662
|
33393233313463656335353639633262623335633336613030633435363232316632313031663034
|
||||||
37616536636330353839626661383036336665353161373138653635326461343532653964396266
|
34366130346135336365376332383637343761303435623138613533393561613039353561663866
|
||||||
65633839663739633636653466643438353636363836313064383966656163303336306535313863
|
66636139323138376566643239383563363738363130373735653365363133303864386462333065
|
||||||
6631383465353530636230376530373562383063366631623136
|
63623934623032353638643034363439616333646530306430346461393264323661376335393366
|
||||||
|
62656639633339303536643535383035383964623761386166373135323465663132323262663961
|
||||||
|
39313365616266333636
|
||||||
|
22
inventory/group_vars/drone
Normal file
22
inventory/group_vars/drone
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
drone_gitea_server: https://git.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
|
||||||
|
|
||||||
|
project_src: "/home/valentin/drone"
|
||||||
|
|
||||||
|
project_directory:
|
||||||
|
- "{{ project_src }}"
|
||||||
|
|
||||||
|
project_env: env-drone.j2
|
||||||
|
docker_compose_file: "docker-compose-drone.yml.j2"
|
||||||
|
|
||||||
|
ports_tcp:
|
||||||
|
- 8000
|
||||||
|
- 9000
|
18
inventory/group_vars/drone_vault
Normal file
18
inventory/group_vars/drone_vault
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
|
38303932316262306464333166316363643239366561323234643563623362336335613237376239
|
||||||
|
3535393466323064333163363932663731663031663933350a323431653239396663343666373765
|
||||||
|
31373066383234303139663135326462613539626363373930346366383831646536316465373563
|
||||||
|
3537653761373233300a383637623932616663393763643066326238633932643730336339336330
|
||||||
|
38366430336561613866373634313130616438313234666431396638366161613839303864353561
|
||||||
|
35613234326539383765666637323236303161623061633164646430663834393764623931656638
|
||||||
|
63336533383065343738373564393266653738656163643165383434623836666434646337336565
|
||||||
|
32373261636363396363343236353336306331313761623531653834346536353039656564316138
|
||||||
|
66643166653435666162383333366233353165393837303539646538353765653465363532346231
|
||||||
|
65633365353131613437623663313934626461313437373730623164636364393362366537373162
|
||||||
|
62363965323662356638633661363236326437353366356134346333313466323139336362363234
|
||||||
|
62376262346338643339363566303339366165636566623565363238363736646637646635303531
|
||||||
|
38343031666635323539353431316164353830363838313662613063616532623730346561333665
|
||||||
|
33316137613666636439383364353735653535346537383831323333646238356534393935643435
|
||||||
|
31643637323366616230633039336633313631316330323064306638663039393330376366633930
|
||||||
|
65643861363231313033333662396339636432343133336561356438636233643762313539323166
|
||||||
|
6261
|
@@ -1,4 +1,20 @@
|
|||||||
project_terraform: "/home/valentin/terraform"
|
project_terraform: "/home/valentin/terraform"
|
||||||
|
project_backend: "/home/valentin/k8s_backend"
|
||||||
|
project_kubeconfig: "/home/valentin/.kube/config"
|
||||||
region_k8s: "fr-par"
|
region_k8s: "fr-par"
|
||||||
project_name: "terraform-test"
|
project_name_tf: "terraform-test"
|
||||||
quarkus_project: "covas-quarkus"
|
quarkus_project: "covas-quarkus"
|
||||||
|
|
||||||
|
mailer_host: "smtp.gmail.com"
|
||||||
|
mailer_from: "valczebackup@gmail.com"
|
||||||
|
mailer_port: "587"
|
||||||
|
|
||||||
|
port: 8083
|
||||||
|
targetPort: 8080
|
||||||
|
|
||||||
|
|
||||||
|
backend_yaml:
|
||||||
|
- backend-deployment
|
||||||
|
- backend-service
|
||||||
|
- env-configmap
|
||||||
|
- secret
|
@@ -1,10 +1,46 @@
|
|||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
38396665356139383861356137373362393834373765663937373730333434356565383864333137
|
30356465363432393266326366393162306331353564346565663139336538613832396135306537
|
||||||
3763386361323938326462393632346565386432336531620a616261656133323236343464303837
|
6262336438613736636266623766333233336631656661640a663838373936613666373133383632
|
||||||
39613966333435393336396361666337306438393138363961336462383666326363326439373762
|
32613962623330303964333161373165363164646266396461633233346136336630646631306564
|
||||||
6139623462323133330a646432336365666164643435383430616137313130646137623463373636
|
3939363432643961610a313338306136303132666461393637643235623361393830653534643137
|
||||||
32313561383838366437633634376434616438633665363465626633633537383435616537336339
|
38623038613364396538353533336631633863343834333030653164303231346263316435356231
|
||||||
64313836613730613135363739363536356362373762313431353938653738613666313966393163
|
61383966663834333662393138303035613330366533663037326532356332633839363763356466
|
||||||
33336234363964633633663431353966666530353432643461656336356166393837316634313164
|
63396536323864383933346434363231396164613838316162656333626634373936643738386565
|
||||||
65653033636338363563666363326433636163323363656530323834303464356136346163353466
|
32326532346334343666383632306264636132613266333863626462366530306439613130333564
|
||||||
3533
|
38623461613739343461386564323865316332653530623862313163396566616230653030653266
|
||||||
|
61613836303231363534393531373233363332316639316137653132336638356161333764373562
|
||||||
|
34363034353935633437353466303364653039626137383534633239316563373663623030646330
|
||||||
|
38383639326563643266346530616666646337373765643336326536303864613363663536643465
|
||||||
|
34343663373131323437666462303763366439356362306337356131383932353731393935343931
|
||||||
|
32613333373439343864653864636438646431306637613038313061663961653033643465643864
|
||||||
|
31333366663037373835326330316535326134393761333662326665333464666164623336666439
|
||||||
|
35313066303830343737343063396335383461653338303734353461643736343163346565323864
|
||||||
|
65356437376663386535646437653566326532346462313932346435393730366530646164323537
|
||||||
|
35363633333065356162653762623239343836356230303734316130383234313536623339626531
|
||||||
|
36643434336233626234333235636566313566353939616433373465666362316663353336653162
|
||||||
|
32346534333665353934653738343335356137643539376639323164393837383065323436363064
|
||||||
|
35643762656365313261373030336339616266333765613735346565623138366533626335633033
|
||||||
|
38373732626337353535656230636235373535363332376535343162666266393931303236653631
|
||||||
|
33653432633337306230396434316230663438363630313038386538663732393863633837313638
|
||||||
|
31663763303462343063613638663361626462623035336465383661646433643833636361346236
|
||||||
|
32386263326664363338633861643264383462313863666662623033323761613132666130353235
|
||||||
|
34633261303761623033633964323862666137333035306333323932346334356365333563316630
|
||||||
|
34313263306561303538353134613233313337323636623230616532383133613561333439663337
|
||||||
|
64376230363038306238656236653366353738633436623330383239373062313831393066313838
|
||||||
|
38653532356632383765613530373034396639633064383336393934353061656266633463336333
|
||||||
|
66356538616233313936376565386432303134306363343734333563333266643062666231303532
|
||||||
|
37363664396165653333656661376334333432376566666237316232643234386332323936346630
|
||||||
|
63303563363162356666643732366131393066333838363935613336353062633862353838613761
|
||||||
|
64333939663733643132366334653835633733623539393735313961613131303934363731663231
|
||||||
|
64313434613934336630306165343665376261353562656634356365613137346232633431343734
|
||||||
|
63363532313765646434346132313434373366656332353133383530306639633062633365613932
|
||||||
|
65383865643262666666383933363534623838653661376531303763623261323937626335373635
|
||||||
|
32623262343130383462316462643338363433653133353737633562353330313533303835666634
|
||||||
|
65386336616466316663356236316466353164353139326333316362303737343335353731366531
|
||||||
|
36653062323764316332353136343738616338313465333261363664663934393038343237313135
|
||||||
|
64363036636634646137616365366538613338343761646137623432396539363035663031313464
|
||||||
|
66646663373838316161643161613838343139346165663331373334383334316562353235633461
|
||||||
|
65316666616334653034393165616434306664633336613639636433663761363932396663396630
|
||||||
|
64383961623136623639306435663965303632663039653538646463663235653333306434313931
|
||||||
|
32636536643536636561663534346633663464333830646139383939626665393964353739616435
|
||||||
|
35663834393738646130316564633966653765303033356132393961653831646362
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
35333863396561393462653263323133343233346534616138616530643066323161656534653738
|
61643965343735653231363764646132363434653530346532343765663036376434353334356330
|
||||||
3335306466663636623236383435663337393466633437660a303961663331653463343933353966
|
6133383634643439353338383039653234303666306661350a636366343465356639646535663234
|
||||||
35636161393663386137306561613965653438626432323865323233636662653333616532636665
|
31356434363130663961653638363463333330346561333933643263643362343132376131313764
|
||||||
3562333936366238640a646262373233363665366437653032303238313266356138343239303936
|
3439663335386235610a396435303138666166383363303038663163393538323362313965613933
|
||||||
36663531303061663763653637333365303664666563353631303435633462343537
|
65666338653533386234336365316664313266326130313064653864386235323461303938386333
|
||||||
|
3239646561363831643530633466613035643630363761326666
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
|
msg: registry
|
||||||
project_src: "/home/valentin/registry"
|
project_src: "/home/valentin/registry"
|
||||||
|
|
||||||
project_directory:
|
project_directory:
|
||||||
- "{{ project_src }}"
|
- "{{ project_src }}"
|
||||||
|
|
||||||
docker_compose_file: "docker-compose-registry.yml"
|
|
||||||
|
docker_compose_file: "docker-compose-registry.yml.j2"
|
||||||
|
|
||||||
|
|
||||||
ports_tcp:
|
ports_tcp:
|
||||||
|
@@ -1,10 +1,14 @@
|
|||||||
vps ansible_connection=ssh ansible_host=51.222.107.37 ansible_port=2424 ansible_user=valentin
|
vps-host ansible_connection=ssh ansible_host=51.222.107.37 ansible_port=2424 ansible_user=valentin
|
||||||
valentin-nas ansible_connection=ssh ansible_host=151.80.37.38 ansible_port=2424 ansible_user=valentin
|
valentin-nas ansible_connection=ssh ansible_host=151.80.37.38 ansible_port=2424 ansible_user=valentin
|
||||||
localhost ansible_host=127.0.0.1
|
drone-host ansible_connection=ssh ansible_host=151.80.37.38 ansible_port=2424 ansible_user=valentin
|
||||||
|
localhost ansible_host=127.0.0.1 ansible_python_interpreter=/usr/bin/python3.10
|
||||||
|
|
||||||
[db]
|
[vps]
|
||||||
|
vps-host
|
||||||
|
|
||||||
|
[db:children]
|
||||||
|
local
|
||||||
vps
|
vps
|
||||||
localhost
|
|
||||||
|
|
||||||
[db_vault:children]
|
[db_vault:children]
|
||||||
db
|
db
|
||||||
@@ -12,8 +16,16 @@ db
|
|||||||
[nas]
|
[nas]
|
||||||
valentin-nas
|
valentin-nas
|
||||||
|
|
||||||
[registry:children]
|
|
||||||
nas
|
[registry]
|
||||||
|
valentin-nas
|
||||||
|
|
||||||
|
|
||||||
|
[drone]
|
||||||
|
drone-host
|
||||||
|
|
||||||
|
[drone_vault:children]
|
||||||
|
drone
|
||||||
|
|
||||||
[nas_vault:children]
|
[nas_vault:children]
|
||||||
nas
|
nas
|
||||||
|
@@ -1,9 +1,10 @@
|
|||||||
---
|
---
|
||||||
- hosts: registry db
|
- hosts: registry vps
|
||||||
remote_user: valentin
|
remote_user: valentin
|
||||||
roles:
|
roles:
|
||||||
- server
|
- server
|
||||||
|
|
||||||
|
|
||||||
- hosts: local
|
- hosts: local
|
||||||
remote_user: valentin
|
remote_user: valentin
|
||||||
roles:
|
roles:
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
/home/valentin/.ansible/collections/ansible_collections:
|
collections:
|
||||||
community.docker:
|
|
||||||
version: 3.1.0
|
|
||||||
/usr/lib/python3.10/site-packages/ansible_collections:
|
|
||||||
amazon.aws:
|
amazon.aws:
|
||||||
version: 3.4.0
|
version: 3.4.0
|
||||||
ansible.netcommon:
|
ansible.netcommon:
|
||||||
|
1
scaleway-k8s/files/requierements.txt
Normal file
1
scaleway-k8s/files/requierements.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ovh
|
@@ -27,4 +27,34 @@
|
|||||||
- name: Template env file
|
- name: Template env file
|
||||||
template:
|
template:
|
||||||
src: "env-build.j2"
|
src: "env-build.j2"
|
||||||
dest: "{{ home_dir }}/{{ quarkus_project }}/.env"
|
dest: "{{ home_dir }}/{{ quarkus_project }}/.env"
|
||||||
|
|
||||||
|
- name: Pause for build image
|
||||||
|
pause:
|
||||||
|
prompt: aller au dossier {{ home_dir }}/{{ quarkus_project }}, et exécuter le script build-image.sh
|
||||||
|
|
||||||
|
- name: Get quarkus image
|
||||||
|
docker_image_info:
|
||||||
|
name: quarkus-native
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: Check quarkus image
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- result.images | length == 1
|
||||||
|
|
||||||
|
- name: Login to scaleway registry
|
||||||
|
docker_login:
|
||||||
|
registry_url: rg.fr-par.scw.cloud/covas
|
||||||
|
username: nologin
|
||||||
|
password: "{{ token_scaleway }}"
|
||||||
|
reauthorize: true
|
||||||
|
|
||||||
|
|
||||||
|
- name: Tag and push to custom registry
|
||||||
|
docker_image:
|
||||||
|
name: quarkus-native
|
||||||
|
repository: rg.fr-par.scw.cloud/covas/quarkus-native
|
||||||
|
tag: latest
|
||||||
|
push: yes
|
||||||
|
source: local
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
src: main.tf.j2
|
src: main.tf.j2
|
||||||
dest: "{{ project_terraform }}/main.tf"
|
dest: "{{ project_terraform }}/main.tf"
|
||||||
|
|
||||||
|
|
||||||
- name: Create cluster scaleway
|
- name: Create cluster scaleway
|
||||||
community.general.terraform:
|
community.general.terraform:
|
||||||
project_path: '{{ project_terraform }}'
|
project_path: '{{ project_terraform }}'
|
||||||
|
98
scaleway-k8s/tasks/deploy-backend.yml
Normal file
98
scaleway-k8s/tasks/deploy-backend.yml
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
---
|
||||||
|
# tasks file for create cluster k8s via terraform
|
||||||
|
|
||||||
|
- name: Create directory {{ project_terraform }}
|
||||||
|
file:
|
||||||
|
path: "{{ project_backend }}"
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Copy backend k8s yaml
|
||||||
|
template:
|
||||||
|
src: "{{ item }}.yaml.j2"
|
||||||
|
dest: "{{ project_backend }}/{{ item }}.yaml"
|
||||||
|
with_items: "{{ backend_yaml }}"
|
||||||
|
|
||||||
|
- name: Create a k8s namespace
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
name: testing
|
||||||
|
api_version: v1
|
||||||
|
kind: Namespace
|
||||||
|
state: present
|
||||||
|
|
||||||
|
|
||||||
|
- name: Apply deployment
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
src: "{{ project_backend }}/backend-deployment.yaml"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Apply services
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
src: "{{ project_backend }}/backend-service.yaml"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Apply configmap
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
src: "{{ project_backend }}/env-configmap.yaml"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
|
||||||
|
- name: Apply secret
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
src: "{{ project_backend }}/secret.yaml"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: En attente d'une adresse IP publique du cluster
|
||||||
|
ansible.builtin.pause:
|
||||||
|
minutes: 2
|
||||||
|
|
||||||
|
- name: Get IP Cluster
|
||||||
|
block:
|
||||||
|
- name: Fetch services
|
||||||
|
set_fact:
|
||||||
|
service: "{{ query('kubernetes.core.k8s', kind='Service', namespace='testing') }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: debug services
|
||||||
|
debug:
|
||||||
|
msg: "{{ result.ansible_facts.service[0].status.loadBalancer.ingress[0].ip }}"
|
||||||
|
|
||||||
|
- name: Test API Backend
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: "http://{{ result.ansible_facts.service[0].status.loadBalancer.ingress[0].ip }}:{{ port }}/api/hello"
|
||||||
|
status_code: 200
|
||||||
|
method: GET
|
||||||
|
tags: ["services", "dns"]
|
||||||
|
|
||||||
|
- name: Add DNS for IP Cluster
|
||||||
|
block:
|
||||||
|
- name: Copy script add or update DNS
|
||||||
|
template:
|
||||||
|
src: "dns_add_update.py.j2"
|
||||||
|
dest: "{{ project_backend }}/dns_add_update.py"
|
||||||
|
|
||||||
|
- name: Copy requierements python
|
||||||
|
copy:
|
||||||
|
src: "requierements.txt"
|
||||||
|
dest: "{{ project_backend }}"
|
||||||
|
|
||||||
|
- name: Pip install requierements
|
||||||
|
shell: "pip3.10 install -r {{ project_backend }}/requierements.txt"
|
||||||
|
|
||||||
|
- name: En attente de l'installation des packages
|
||||||
|
ansible.builtin.pause:
|
||||||
|
minutes: 2
|
||||||
|
|
||||||
|
- name: Add or update DNS
|
||||||
|
shell: "python3.10 {{ project_backend }}/dns_add_update.py --ip {{ result.ansible_facts.service[0].status.loadBalancer.ingress[0].ip }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: Display result script
|
||||||
|
debug:
|
||||||
|
msg: "{{ result }}"
|
||||||
|
|
||||||
|
- name: Test API Backend with DNS
|
||||||
|
ansible.builtin.uri:
|
||||||
|
url: "http://api.valczeryba.ovh:{{ port }}/api/hello"
|
||||||
|
status_code: 200
|
||||||
|
method: GET
|
||||||
|
tags: [ "dns" ]
|
42
scaleway-k8s/tasks/destroy-backend.yml
Normal file
42
scaleway-k8s/tasks/destroy-backend.yml
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
# tasks file for create cluster k8s via terraform
|
||||||
|
|
||||||
|
- name: Apply deployment
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
src: "{{ project_backend }}/backend-deployment.yaml"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Apply services
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
src: "{{ project_backend }}/backend-service.yaml"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Apply configmap
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
src: "{{ project_backend }}/env-configmap.yaml"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
|
||||||
|
- name: Apply secret
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
src: "{{ project_backend }}/secret.yaml"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
|
||||||
|
- name: Create a k8s namespace
|
||||||
|
kubernetes.core.k8s:
|
||||||
|
name: testing
|
||||||
|
api_version: v1
|
||||||
|
kind: Namespace
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
|
||||||
|
- name: Create directory {{ project_terraform }}
|
||||||
|
file:
|
||||||
|
path: "{{ project_backend }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@@ -16,6 +16,10 @@
|
|||||||
method: GET
|
method: GET
|
||||||
headers:
|
headers:
|
||||||
X-Auth-Token: "{{ scw_secret_key }}"
|
X-Auth-Token: "{{ scw_secret_key }}"
|
||||||
when: item.name == "{{ project_name }}"
|
when: item.name == "{{ project_name_tf }}"
|
||||||
with_items: "{{ (output.content |from_json).clusters }}"
|
with_items: "{{ (output.content |from_json).clusters }}"
|
||||||
|
|
||||||
|
- name: Copy kubeconfig
|
||||||
|
copy:
|
||||||
|
src: "{{ project_terraform }}/kubeconfig"
|
||||||
|
dest: "{{ project_kubeconfig }}"
|
@@ -1,15 +1,24 @@
|
|||||||
- name: Create folder for image
|
- name: Create folder for image
|
||||||
ansible.builtin.import_tasks: create-build.yml
|
import_tasks: create-build.yml
|
||||||
tags: ["create-build"]
|
tags: ["create-build"]
|
||||||
|
|
||||||
- name: Create cluster k8s scaleway via terraform
|
- name: Create cluster k8s scaleway via terraform
|
||||||
ansible.builtin.import_tasks: create-cluster.yml
|
import_tasks: create-cluster.yml
|
||||||
tags: ["create-cluster"]
|
tags: ["create-cluster"]
|
||||||
|
|
||||||
- name: Get id Cluster
|
- name: Get id Cluster
|
||||||
ansible.builtin.import_tasks: kubeconfig.yml
|
import_tasks: kubeconfig.yml
|
||||||
tags: ["create-cluster", "kubeconfig"]
|
tags: ["create-cluster", "kubeconfig"]
|
||||||
|
|
||||||
|
- name: Deploy a API backend
|
||||||
|
import_tasks: deploy-backend.yml
|
||||||
|
tags: ["deploy"]
|
||||||
|
|
||||||
|
- name: Deploy a API backend
|
||||||
|
import_tasks: destroy-backend.yml
|
||||||
|
tags: ["destroy"]
|
||||||
|
|
||||||
|
|
||||||
- name: Destroy cluster k8s scaleway via terraform
|
- name: Destroy cluster k8s scaleway via terraform
|
||||||
ansible.builtin.import_tasks: destroy-cluster.yml
|
import_tasks: destroy-cluster.yml
|
||||||
tags: ["destroy-cluster"]
|
tags: ["destroy-cluster"]
|
||||||
|
98
scaleway-k8s/templates/backend-deployment.yaml.j2
Normal file
98
scaleway-k8s/templates/backend-deployment.yaml.j2
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
kompose.cmd: kompose convert -f ../docker-compose.yml
|
||||||
|
kompose.version: 1.26.0 (40646f47)
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
io.kompose.service: backend
|
||||||
|
name: backend
|
||||||
|
namespace: testing
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
io.kompose.service: backend
|
||||||
|
strategy: {}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
kompose.cmd: kompose convert -f ../docker-compose.yml
|
||||||
|
kompose.version: 1.26.0 (40646f47)
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
io.kompose.service: backend
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: regcred
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: POSTGRES_DB
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: POSTGRES_DB
|
||||||
|
name: env
|
||||||
|
- name: POSTGRES_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: POSTGRES_PASSWORD
|
||||||
|
name: env
|
||||||
|
- name: POSTGRES_PORT
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: POSTGRES_PORT
|
||||||
|
name: env
|
||||||
|
- name: POSTGRES_URL
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: POSTGRES_URL
|
||||||
|
name: env
|
||||||
|
- name: POSTGRES_USER
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: POSTGRES_USER
|
||||||
|
name: env
|
||||||
|
- name: REDIS_PORT
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: REDIS_PORT
|
||||||
|
name: env
|
||||||
|
- name: REDIS_URL
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: REDIS_URL
|
||||||
|
name: env
|
||||||
|
- name: MAILER_FROM
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: MAILER_FROM
|
||||||
|
name: env
|
||||||
|
- name: MAILER_HOST
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: MAILER_HOST
|
||||||
|
name: env
|
||||||
|
- name: MAILER_PORT
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: MAILER_PORT
|
||||||
|
name: env
|
||||||
|
- name: MAILER_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: MAILER_USERNAME
|
||||||
|
name: env
|
||||||
|
- name: MAILER_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
key: MAILER_PASSWORD
|
||||||
|
name: env
|
||||||
|
image: rg.fr-par.scw.cloud/covas/quarkus-native
|
||||||
|
name: backend
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
|
resources: {}
|
||||||
|
restartPolicy: Always
|
||||||
|
status: {}
|
21
scaleway-k8s/templates/backend-service.yaml.j2
Normal file
21
scaleway-k8s/templates/backend-service.yaml.j2
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
kompose.cmd: kompose convert -f ../docker-compose.yml
|
||||||
|
kompose.version: 1.26.0 (40646f47)
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
io.kompose.service: backend
|
||||||
|
name: backend
|
||||||
|
namespace: testing
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: "{{ port }}"
|
||||||
|
port: {{ port }}
|
||||||
|
targetPort: {{ targetPort }}
|
||||||
|
type: LoadBalancer
|
||||||
|
selector:
|
||||||
|
io.kompose.service: backend
|
||||||
|
status:
|
||||||
|
loadBalancer: {}
|
49
scaleway-k8s/templates/dns_add_update.py.j2
Normal file
49
scaleway-k8s/templates/dns_add_update.py.j2
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# -*- encoding: utf-8 -*-
|
||||||
|
'''
|
||||||
|
First, install the latest release of Python wrapper: $ pip install ovh
|
||||||
|
'''
|
||||||
|
import json
|
||||||
|
import ovh
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('--ip', help='foo help')
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# Instanciate an OVH Client.
|
||||||
|
# You can generate new credentials with full access to your account on
|
||||||
|
# the token creation page
|
||||||
|
client = ovh.Client(
|
||||||
|
endpoint='ovh-eu', # Endpoint of API OVH Europe (List of available endpoints)
|
||||||
|
application_key='{{ application_key }}', # Application Key
|
||||||
|
application_secret='{{ application_secret }}', # Application Secret
|
||||||
|
consumer_key='{{ consumer_key }}', # Consumer Key
|
||||||
|
)
|
||||||
|
|
||||||
|
result = client.get('/domain/zone/valczeryba.ovh/record',
|
||||||
|
fieldType='A',
|
||||||
|
subDomain='api',
|
||||||
|
)
|
||||||
|
|
||||||
|
# Pretty print
|
||||||
|
|
||||||
|
if len(result) > 0:
|
||||||
|
for idDns in result:
|
||||||
|
result = client.get('/domain/zone/valczeryba.ovh/record/{0}'.format(idDns))
|
||||||
|
if result["target"] != args.ip:
|
||||||
|
result = client.put('/domain/zone/valczeryba.ovh/record/{0}'.format(idDns),
|
||||||
|
subDomain='api',
|
||||||
|
target=args.ip,
|
||||||
|
)
|
||||||
|
print(result)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
else:
|
||||||
|
result = client.post('/domain/zone/valczeryba.ovh/record',
|
||||||
|
fieldType='A',
|
||||||
|
subDomain='api',
|
||||||
|
target=args.ip,
|
||||||
|
ttl=None,
|
||||||
|
)
|
||||||
|
print(result)
|
@@ -5,3 +5,10 @@ POSTGRES_URL={{ postgres_url }}
|
|||||||
POSTGRES_PORT={{ postgres_port }}
|
POSTGRES_PORT={{ postgres_port }}
|
||||||
REDIS_URL={{ redis_url }}
|
REDIS_URL={{ redis_url }}
|
||||||
REDIS_PORT={{ redis_port }}
|
REDIS_PORT={{ redis_port }}
|
||||||
|
|
||||||
|
|
||||||
|
MAILER_FROM={{ mailer_from }}
|
||||||
|
MAILER_HOST={{ mailer_host }}
|
||||||
|
MAILER_PORT={{ mailer_port }}
|
||||||
|
MAILER_USERNAME={{ mailer_username }}
|
||||||
|
MAILER_PASSWORD={{ mailer_password }}
|
22
scaleway-k8s/templates/env-configmap.yaml.j2
Normal file
22
scaleway-k8s/templates/env-configmap.yaml.j2
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
POSTGRES_DB: {{ postgres_db }}
|
||||||
|
POSTGRES_PASSWORD: {{ postgres_password }}
|
||||||
|
POSTGRES_PORT: "{{ postgres_port }}"
|
||||||
|
POSTGRES_URL: {{ postgres_url }}
|
||||||
|
POSTGRES_USER: {{ postgres_user }}
|
||||||
|
REDIS_PORT: "{{ redis_port }}"
|
||||||
|
REDIS_URL: {{ redis_url }}
|
||||||
|
MAILER_FROM: {{ mailer_from }}
|
||||||
|
MAILER_HOST: {{ mailer_host }}
|
||||||
|
MAILER_PORT: "{{ mailer_port }}"
|
||||||
|
MAILER_USERNAME: {{ mailer_username }}
|
||||||
|
MAILER_PASSWORD: {{ mailer_password }}
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
io.kompose.service: backend-env
|
||||||
|
name: env
|
||||||
|
namespace: testing
|
||||||
|
|
@@ -8,8 +8,8 @@ terraform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
resource "scaleway_k8s_cluster" "{{ project_name }}" {
|
resource "scaleway_k8s_cluster" "{{ project_name_tf }}" {
|
||||||
name = "{{ project_name }}"
|
name = "{{ project_name_tf }}"
|
||||||
version = "1.24.3"
|
version = "1.24.3"
|
||||||
cni = "cilium"
|
cni = "cilium"
|
||||||
project_id = "{{ project_id }}"
|
project_id = "{{ project_id }}"
|
||||||
@@ -17,7 +17,7 @@ terraform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "scaleway_k8s_pool" "john" {
|
resource "scaleway_k8s_pool" "john" {
|
||||||
cluster_id = scaleway_k8s_cluster.{{ project_name }}.id
|
cluster_id = scaleway_k8s_cluster.{{ project_name_tf }}.id
|
||||||
name = "john"
|
name = "john"
|
||||||
node_type = "DEV1-M"
|
node_type = "DEV1-M"
|
||||||
size = 1
|
size = 1
|
||||||
@@ -26,9 +26,9 @@ terraform {
|
|||||||
resource "null_resource" "kubeconfig" {
|
resource "null_resource" "kubeconfig" {
|
||||||
depends_on = [scaleway_k8s_pool.john] # at least one pool here
|
depends_on = [scaleway_k8s_pool.john] # at least one pool here
|
||||||
triggers = {
|
triggers = {
|
||||||
host = scaleway_k8s_cluster.{{ project_name }}.kubeconfig[0].host
|
host = scaleway_k8s_cluster.{{ project_name_tf }}.kubeconfig[0].host
|
||||||
token = scaleway_k8s_cluster.{{ project_name }}.kubeconfig[0].token
|
token = scaleway_k8s_cluster.{{ project_name_tf }}.kubeconfig[0].token
|
||||||
cluster_ca_certificate = scaleway_k8s_cluster.{{ project_name }}.kubeconfig[0].cluster_ca_certificate
|
cluster_ca_certificate = scaleway_k8s_cluster.{{ project_name_tf }}.kubeconfig[0].cluster_ca_certificate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,4 +41,4 @@ provider "kubernetes" {
|
|||||||
cluster_ca_certificate = base64decode(
|
cluster_ca_certificate = base64decode(
|
||||||
null_resource.kubeconfig.triggers.cluster_ca_certificate
|
null_resource.kubeconfig.triggers.cluster_ca_certificate
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
10
scaleway-k8s/templates/secret.yaml.j2
Normal file
10
scaleway-k8s/templates/secret.yaml.j2
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
.dockerconfigjson: {{ dockerconfigjson }}
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: "2022-11-26T19:19:41Z"
|
||||||
|
name: regcred
|
||||||
|
namespace: testing
|
||||||
|
uid: {{ uid_secret }}
|
||||||
|
type: kubernetes.io/dockerconfigjson
|
3
server/tasks/debug.yml
Normal file
3
server/tasks/debug.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
- name: debug
|
||||||
|
debug:
|
||||||
|
msg: "coucou {{ msg }}"
|
@@ -30,6 +30,6 @@
|
|||||||
when: "project_env is defined"
|
when: "project_env is defined"
|
||||||
|
|
||||||
- name: Copy docker compose server file
|
- name: Copy docker compose server file
|
||||||
copy:
|
template:
|
||||||
src: "{{ docker_compose_file }}"
|
src: "{{ docker_compose_file }}"
|
||||||
dest: "{{ project_src }}/docker-compose.yml"
|
dest: "{{ project_src }}/docker-compose.yml"
|
||||||
|
@@ -1,19 +1,24 @@
|
|||||||
---
|
---
|
||||||
# tasks file for server
|
# tasks file for server
|
||||||
|
|
||||||
|
|
||||||
|
- name: Debug role
|
||||||
|
import_tasks: debug.yml
|
||||||
|
tags: ["debug"]
|
||||||
|
|
||||||
- name: Deploy services
|
- name: Deploy services
|
||||||
ansible.builtin.import_tasks: deploy.yml
|
import_tasks: deploy.yml
|
||||||
tags: ["deploy", "create"]
|
tags: ["configure", "create"]
|
||||||
|
|
||||||
- name: Start services
|
- name: Start services
|
||||||
ansible.builtin.import_tasks: start.yml
|
import_tasks: start.yml
|
||||||
tags: ["deploy", "start"]
|
tags: ["configure", "start"]
|
||||||
|
|
||||||
|
|
||||||
- name: stop services
|
- name: stop services
|
||||||
ansible.builtin.import_tasks: stop.yml
|
import_tasks: stop.yml
|
||||||
tags: ["destroy", "stop"]
|
tags: ["deconfigure", "stop"]
|
||||||
|
|
||||||
- name: Remove services
|
- name: Remove services
|
||||||
ansible.builtin.import_tasks: remove.yml
|
import_tasks: remove.yml
|
||||||
tags: ["destroy"]
|
tags: ["deconfigure"]
|
||||||
|
@@ -15,4 +15,8 @@
|
|||||||
- name: Remove project
|
- name: Remove project
|
||||||
file:
|
file:
|
||||||
path: "{{ project_src }}"
|
path: "{{ project_src }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
vars:
|
||||||
|
ansible_become: yes
|
||||||
|
ansible_become_method: sudo
|
||||||
|
ansible_become_password: "{{ sudo_password }}"
|
@@ -11,12 +11,20 @@ services:
|
|||||||
- PGDATA=/var/lib/postgresql/data/pgdata
|
- PGDATA=/var/lib/postgresql/data/pgdata
|
||||||
ports:
|
ports:
|
||||||
- "54321:5432"
|
- "54321:5432"
|
||||||
|
|
||||||
|
|
||||||
|
mongo:
|
||||||
|
image: mongo
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
ports:
|
||||||
|
- "28017:27017"
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis/redis-stack-server:latest
|
image: redis/redis-stack-server:latest
|
||||||
ports:
|
ports:
|
||||||
- "63791:6379"
|
- "63791:6379"
|
||||||
|
{% if covas_liquibase == true %}
|
||||||
liquibase:
|
liquibase:
|
||||||
build:
|
build:
|
||||||
context: ./covas-liquibase
|
context: ./covas-liquibase
|
||||||
@@ -25,6 +33,7 @@ services:
|
|||||||
- db
|
- db
|
||||||
command:
|
command:
|
||||||
- "update"
|
- "update"
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
app-db-data:
|
app-db-data:
|
51
server/templates/docker-compose-drone.yml.j2
Normal file
51
server/templates/docker-compose-drone.yml.j2
Normal file
@@ -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
|
@@ -7,5 +7,6 @@ services:
|
|||||||
- "5000:5000"
|
- "5000:5000"
|
||||||
environment:
|
environment:
|
||||||
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
|
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data
|
- ./data:/data
|
@@ -1,3 +1,6 @@
|
|||||||
POSTGRES_PASSWORD={{ postgres_password }}
|
POSTGRES_PASSWORD={{ postgres_password }}
|
||||||
POSTGRES_USER={{ postgres_user }}
|
POSTGRES_USER={{ postgres_user }}
|
||||||
POSTGRES_DB={{ postgres_db }}
|
POSTGRES_DB={{ postgres_db }}
|
||||||
|
|
||||||
|
MONGO_INITDB_ROOT_USERNAME={{ mongo_user }}
|
||||||
|
MONGO_INITDB_ROOT_PASSWORD={{ mongo_password }}
|
8
server/templates/env-drone.j2
Normal file
8
server/templates/env-drone.j2
Normal file
@@ -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 }}
|
Reference in New Issue
Block a user