Browse Source

Remove Drone CI

master
Andreas Linz 1 year ago
parent
commit
ff025d85d9
Signed by: alinz GPG Key ID: 9BF39809C9DA580C
11 changed files with 0 additions and 211 deletions
  1. +0
    -3
      build/droneci/.gitignore
  2. +0
    -29
      build/droneci/Makefile
  3. +0
    -1
      playbook.yml
  4. +0
    -21
      roles/caddy/templates/Caddyfile.tmpl
  5. +0
    -5
      roles/droneci/defaults/main.yml
  6. +0
    -10
      roles/droneci/handlers/main.yml
  7. +0
    -93
      roles/droneci/tasks/main.yml
  8. BIN
      roles/droneci/templates/.drone-server.service.tmpl.swp
  9. +0
    -21
      roles/droneci/templates/drone-agent.service.tmpl
  10. +0
    -21
      roles/droneci/templates/drone-server.service.tmpl
  11. +0
    -7
      roles/droneci/templates/droneci.tmpl

+ 0
- 3
build/droneci/.gitignore View File

@ -1,3 +0,0 @@
/drone-agent
/drone-server
/drone-src*/

+ 0
- 29
build/droneci/Makefile View File

@ -1,29 +0,0 @@
.PHONY: clean
VERSION :=v1.2.3
DRONE_SRC:=drone-src-$(VERSION)
GOPATH :=$(shell pwd)/$(DRONE_SRC)/.go
all: drone-agent drone-server
drone-agent: $(DRONE_SRC) checkout-version $(GOPATH)
cd $(DRONE_SRC) && go get -v github.com/drone/drone/cmd/drone-agent
cp $(GOPATH)/bin/$@ $@
drone-server: $(DRONE_SRC) checkout-version $(GOPATH)
cd $(DRONE_SRC) && CGO_ENABLED=0 go get -v github.com/drone/drone/cmd/drone-server
cp $(GOPATH)/bin/$@ $@
$(GOPATH): $(DRONE_SRC)
mkdir -p $@/src/github.com/drone
ln -sf $(shell pwd)/$(DRONE_SRC) $(GOPATH)/src/github.com/drone/drone
$(DRONE_SRC):
git clone https://github.com/drone/drone.git $@
checkout-version: $(DRONE_SRC)
cd $(DRONE_SRC) && git checkout --force --quiet $(VERSION)
clean:
rm -f drone
rm -rf drone-*

+ 0
- 1
playbook.yml View File

@ -18,7 +18,6 @@
- jupyter
- prometheus
- grafana
- droneci
- caddy
- klingt.net
pre_tasks:

+ 0
- 21
roles/caddy/templates/Caddyfile.tmpl View File

@ -145,24 +145,3 @@ proxy.{{ domain }}:443 {
serve_pac
}
}
ci.{{ domain }}:80 {
prometheus
header / X-klingt-net-version "{{ domain_version }}"
errors stderr
redir https://ci.{{ domain }}{uri}
}
ci.{{ domain }}:443 {
prometheus
header / X-klingt-net-version "{{ domain_version }}"
errors stderr
{% if is_staging %}tls self_signed
{% endif %}
gzip {
not /stream/
}
proxy / localhost:{{ drone_port }} {
websocket
transparent
}
}

+ 0
- 5
roles/droneci/defaults/main.yml View File

@ -1,5 +0,0 @@
drone_group: droneci
drone_user: droneci
drone_addr: 127.0.0.1
drone_port: 10003
droneci_db_name: droneci

+ 0
- 10
roles/droneci/handlers/main.yml View File

@ -1,10 +0,0 @@
- name: Restart Drone CI
listen: restart-drone-ci
become: true
systemd:
daemon_reload: yes
name: "{{ item }}"
state: restarted
with_items:
- drone-server
- drone-agent

+ 0
- 93
roles/droneci/tasks/main.yml View File

@ -1,93 +0,0 @@
- name: Update package index
become: true
apt:
update_cache: true
- name: Download GPG key of docker repository
uri:
url: https://download.docker.com/linux/ubuntu/gpg
return_content: yes
register: docker_gpgp
- name: Add GPG key of docker repository
become: true
shell: "echo '{{ docker_gpgp.content }}' | apt-key add -"
- name: Add docker repository
become: true
lineinfile:
create: true
path: /etc/apt/sources.list.d/docker.list
line: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable"
- name: Update package index
apt:
update_cache: true
become: true
- name: Install docker-ce
become: true
apt:
package:
- docker-ce
- name: "Create group {{ drone_group }}"
become: true
group:
name: "{{ drone_group }}"
- name: "Create user {{ drone_user }}"
become: true
user:
name: "{{ drone_user }}"
comment: "Drone CI run user"
append: true
group: "{{ drone_group }}"
groups: docker
shell: /bin/false
- name: Create postgres user droneci
become: true
become_user: postgres
postgresql_user:
name: droneci
password: "{{ droneci_db_password }}"
- name: "Create database {{ droneci_db_name }}"
become: true
become_user: "postgres"
postgresql_db:
name: "{{ droneci_db_name }}"
owner: "{{ drone_user }}"
state: present
- name: Build droneci
command: make -C ./build/droneci
delegate_to: localhost
notify: restart-drone-ci
- name: Install droneci
become: true
copy:
src: "./build/droneci/{{ item }}"
dest: "/usr/bin/{{ item }}"
mode: 0755
with_items:
- drone-agent
- drone-server
- name: Install environment file
become: true
template:
src: droneci.tmpl
dest: /etc/default/droneci
mode: 0644
notify: restart-drone-ci
- name: Install systemd units
become: true
template:
src: "{{ item }}.tmpl"
dest: "/etc/systemd/system/{{ item }}"
mode: 0600
with_items:
- drone-agent.service
- drone-server.service
notify: restart-drone-ci
- name: Start drone-server
become: true
systemd:
daemon_reload: yes
name: "{{ item }}"
state: started
enabled: true
with_items:
- drone-agent
- drone-server

BIN
roles/droneci/templates/.drone-server.service.tmpl.swp View File


+ 0
- 21
roles/droneci/templates/drone-agent.service.tmpl View File

@ -1,21 +0,0 @@
[Unit]
Description=drone-agent of Drone CI
Documentation=https://drone.io/
After=network-online.target
Wants=systemd-networkd-wait-online.service sshd.service
[Service]
Restart=on-abnormal
Environment=DRONE_MAX_PROCS={{ ansible_processor_cores }}
ExecStart=/usr/bin/drone-agent
User={{ drone_user }}
Group={{ drone_group }}
WorkingDirectory=/home/{{ drone_user }}
PrivateTmp=true
PrivateDevices=true
ProtectSystem=full
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target

+ 0
- 21
roles/droneci/templates/drone-server.service.tmpl View File

@ -1,21 +0,0 @@
[Unit]
Description=drone-server of Drone CI
Documentation=https://drone.io/
After=network-online.target
Wants=systemd-networkd-wait-online.service sshd.service
[Service]
Restart=on-abnormal
EnvironmentFile=/etc/default/droneci
ExecStart=/usr/bin/drone-server --server-addr {{ drone_addr }}:{{ drone_port }}
User={{ drone_user }}
Group={{ drone_group }}
WorkingDirectory=/home/{{ drone_user }}
PrivateTmp=true
PrivateDevices=true
ProtectSystem=full
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target

+ 0
- 7
roles/droneci/templates/droneci.tmpl View File

@ -1,7 +0,0 @@
DRONE_DATABASE_DRIVER=postgres
DRONE_DATABASE_DATASOURCE=postgres://{{ drone_user }}:{{ droneci_db_password }}@{{ postgres_host }}:{{ postgres_port }}/{{ droneci_db_name }}
DRONE_HOST=https://ci.{{ domain }}
DRONE_ADMIN={{ user_name }}
DRONE_GITEA=true
DRONE_GITEA_URL=https://git.{{ domain }}
GIN_MODE=release

Loading…
Cancel
Save