-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy.yaml
52 lines (40 loc) · 1.38 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
- hosts: cugergz.chunibyo.xyz
vars:
repo_folder: /root/Panel
remote_user: root
tasks:
- name: "Create directory if not exists"
file:
path: "{{ repo_folder }}"
state: directory
mode: 0755
group: root
owner: root
- name: kill old process
shell: ps aux | grep main.p[y] | awk '{print $2}' | xargs kill
ignore_errors: true
- name: clone repository
git:
repo: https://github.com/chunibyo-wly/LinuxControlPanel.git
dest: "{{ repo_folder }}"
update: yes
force: yes
version: master
- name: create python virtualenv
pip:
requirements: "{{ repo_folder }}/requirements.txt"
virtualenv: "{{ repo_folder }}/venv"
virtualenv_command: /usr/bin/python3 -m venv
- name: install ftp
shell: "sh {{ repo_folder }}/script/install_ftp.sh"
- name: install nginx
shell: "sh {{ repo_folder }}/script/install_nginx.sh"
- name: install cron
shell: "sh {{ repo_folder }}/script/install_crontab.sh"
- name: create database
shell: "cd {{ repo_folder }} && sudo venv/bin/python db/init.py"
- name: install ufw
shell: "sh {{ repo_folder }}/script/install_ufw.sh"
- name: start server
shell: "cd {{ repo_folder }} && nohup sudo {{ repo_folder }}/venv/bin/python main.py > /tmp/LinuxControlPanel.log 2>&1 &"