自动化脚本更新
This commit is contained in:
parent
b5f618bf2f
commit
d4e5b8e679
@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Deploy GoLeaf release
|
||||
hosts: gitea:google-sdk
|
||||
hosts: gitea
|
||||
remote_user: root
|
||||
|
||||
tasks:
|
||||
@ -12,16 +12,21 @@
|
||||
src: /data/admin_backend/release/login_service/login_service
|
||||
dest: /data/meow/login_service/login_service
|
||||
mode: 0755
|
||||
- name: copy start script
|
||||
copy:
|
||||
src: /data/admin_backend/release/login_service/start.sh
|
||||
dest: /data/meow/login_service/start.sh
|
||||
mode: 0755
|
||||
# - name: copy start script
|
||||
# copy:
|
||||
# src: /data/admin_backend/release/login_service/start.sh
|
||||
# dest: /data/meow/login_service/start.sh
|
||||
# mode: 0755
|
||||
# - name: copy config
|
||||
# copy:
|
||||
# src: /data/admin_backend/release/login_service/conf
|
||||
# dest: /data/meow/login_service/
|
||||
# mode: 0644
|
||||
|
||||
- name: restart web
|
||||
shell: sh /data/meow/login_service/start.sh restart
|
||||
# - name: restart web
|
||||
# shell: sh /data/meow/login_service/start.sh restart
|
||||
- name: Enable and start service
|
||||
systemd:
|
||||
name: login
|
||||
state: restarted
|
||||
enabled: yes
|
||||
70
playbook/merge_pet_test-review.yml
Normal file
70
playbook/merge_pet_test-review.yml
Normal file
@ -0,0 +1,70 @@
|
||||
---
|
||||
- name: Deploy GoLeaf release
|
||||
hosts: new-test
|
||||
gather_facts: no
|
||||
remote_user: root
|
||||
vars:
|
||||
goleaf_src: /data/devops/source/main
|
||||
goleaf_dest: /data/Goleaf-review
|
||||
config_src: /data/docs/tool/out/
|
||||
config_dest: /data/Goleaf-review/gamedata/config/
|
||||
pack_script: /data/devops/pack.sh
|
||||
tar_file: /data/Goleaf.tar
|
||||
tar_dest: /data/Goleaf-review
|
||||
|
||||
tasks:
|
||||
|
||||
- name: change git branch
|
||||
shell: cd /codes/pet_home_server && git checkout develop && git pull
|
||||
delegate_to: localhost
|
||||
register: git_result
|
||||
- name: change docs git branch
|
||||
shell: cd /data/docs && git checkout main && git pull
|
||||
delegate_to: localhost
|
||||
|
||||
- name: protoc protobuff
|
||||
shell: cd /data/docs && protoc --go_out=/codes/pet_home_server/src/server/msg ./proto/Gameapi.proto
|
||||
delegate_to: localhost
|
||||
|
||||
- name: sh pack.sh
|
||||
shell: sh /data/devops/pack.sh
|
||||
delegate_to: localhost
|
||||
- name: backup goleaf
|
||||
shell: mv /data/Goleaf-review/main /data/Goleaf-review/main.bak
|
||||
ignore_errors: yes
|
||||
|
||||
- name: copy goleaf
|
||||
copy:
|
||||
src: "{{ goleaf_src }}"
|
||||
dest: "{{goleaf_dest}}"
|
||||
mode: 0755
|
||||
|
||||
- name: parse config
|
||||
shell: cd /data/docs && git pull && python3 /data/docs/tool/cfg/tool_cfg_json.py
|
||||
delegate_to: localhost
|
||||
|
||||
|
||||
- name: archive config
|
||||
archive:
|
||||
path: /data/docs/tool/config/
|
||||
dest: /data/docs/tool/conf.tar
|
||||
format: tar
|
||||
delegate_to: localhost
|
||||
- name: archive backup config
|
||||
archive:
|
||||
path: /data/Goleaf-review/config/
|
||||
dest: /data/Goleaf-review/confbak.tar
|
||||
format: tar
|
||||
ignore_errors: yes
|
||||
- name: copy tar
|
||||
copy:
|
||||
src: /data/docs/tool/conf.tar
|
||||
dest: /data/Goleaf-review/conf.tar
|
||||
- name: unarchive config
|
||||
unarchive:
|
||||
src: /data/Goleaf-review/conf.tar
|
||||
dest: /data/Goleaf-review/config/
|
||||
remote_src: yes
|
||||
# extra_opts: [--overwrite]
|
||||
- name: remove tar
|
||||
shell: rm -f /data/Goleaf-review/conf.tar
|
||||
@ -27,45 +27,6 @@
|
||||
path: /usr/local/admin/dist.zip
|
||||
state: absent
|
||||
|
||||
- name: pack.sh
|
||||
shell: sh /data/admin_backend/release/pack.sh
|
||||
delegate_to: localhost
|
||||
- name: copy template
|
||||
copy:
|
||||
src: /data/admin_backend/template/
|
||||
dest: /usr/local/admin/backend/template
|
||||
- name: copy tar
|
||||
copy:
|
||||
src: /data/admin_backend/release/backend
|
||||
dest: /usr/local/admin/backend
|
||||
|
||||
- name: parse config
|
||||
shell: cd /data/docs && git pull && python3 /data/docs/tool/cfg/tool_cfg_json.py -w
|
||||
delegate_to: localhost
|
||||
|
||||
- name: archive config
|
||||
archive:
|
||||
path: /data/docs/tool/config/
|
||||
dest: /data/docs/tool/conf.tar
|
||||
format: tar
|
||||
delegate_to: localhost
|
||||
|
||||
- name: archive backup config
|
||||
archive:
|
||||
path: "/usr/local/admin/backend/config/"
|
||||
dest: "/usr/local/admin/backend/config.bak.tar"
|
||||
format: tar
|
||||
|
||||
- name: copy tar
|
||||
copy:
|
||||
src: /data/docs/tool/conf.tar
|
||||
dest: /usr/local/admin/backend/conf.tar
|
||||
|
||||
- unarchive:
|
||||
src: /usr/local/admin/backend/conf.tar
|
||||
dest: /usr/local/admin/backend/config/
|
||||
remote_src: yes
|
||||
extra_opts: [--overwrite]
|
||||
- unarchive:
|
||||
src: /usr/local/admin/backend/conf.tar
|
||||
dest: /usr/local/admin/web/config/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user