1
This commit is contained in:
parent
faf732c093
commit
80a18c8f04
15
role/shanhai0625/files/artifact.py
Normal file
15
role/shanhai0625/files/artifact.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
|
res = {}
|
||||||
|
with open('artifact.json', 'r', encoding='utf8') as f:
|
||||||
|
j = json.load(f)
|
||||||
|
data = j['data']
|
||||||
|
keys = [j['keys']] * len(data)
|
||||||
|
for k_array, v_array in zip(keys, data):
|
||||||
|
tmp = {}
|
||||||
|
for k, v in zip(k_array, v_array):
|
||||||
|
tmp[k] = v
|
||||||
|
res[tmp['id']] = tmp
|
||||||
|
|
||||||
|
with open('artifact.json', 'w', encoding='utf8') as f:
|
||||||
|
json.dump(res, f)
|
15
role/shanhai0625/files/ornaments.py
Normal file
15
role/shanhai0625/files/ornaments.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
|
res = {}
|
||||||
|
with open('ornaments.json', 'r', encoding='utf8') as f:
|
||||||
|
j = json.load(f)
|
||||||
|
data = j['data']
|
||||||
|
keys = [j['keys']] * len(data)
|
||||||
|
for k_array, v_array in zip(keys, data):
|
||||||
|
tmp = {}
|
||||||
|
for k, v in zip(k_array, v_array):
|
||||||
|
tmp[k] = v
|
||||||
|
res[tmp['id']] = tmp
|
||||||
|
|
||||||
|
with open('ornaments.json', 'w', encoding='utf8') as f:
|
||||||
|
json.dump(res, f)
|
30
role/shanhai0625/tasks/artifact.yml
Normal file
30
role/shanhai0625/tasks/artifact.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: 下载 equip
|
||||||
|
local_action: subversion
|
||||||
|
args:
|
||||||
|
repo: "{{svn}}/shanhai0625/client/res/samejson/artifact.json"
|
||||||
|
dest: "{{ansible_role_name}}/files/artifact.json"
|
||||||
|
username: "{{username}}"
|
||||||
|
password: "{{password}}"
|
||||||
|
export: yes
|
||||||
|
force: yes
|
||||||
|
|
||||||
|
- name: 适配结构
|
||||||
|
local_action: shell
|
||||||
|
args:
|
||||||
|
chdir: "{{ansible_role_name}}/files/"
|
||||||
|
cmd: "python3 artifact.py"
|
||||||
|
|
||||||
|
- name: 拷贝到gm
|
||||||
|
copy:
|
||||||
|
src: equip.json
|
||||||
|
dest: "{{gmdir}}/{{gmgame}}"
|
||||||
|
|
||||||
|
- name: 拷贝到gc
|
||||||
|
copy:
|
||||||
|
src: equip.json
|
||||||
|
dest: "{{gcdir}}/{{gmgame}}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -7,4 +7,6 @@
|
|||||||
- include: pay.yml
|
- include: pay.yml
|
||||||
#- include: pet.yml
|
#- include: pet.yml
|
||||||
- include: shipin.yml
|
- include: shipin.yml
|
||||||
|
- include: ornaments.yml
|
||||||
|
- include: artifact.yml
|
||||||
#- include: wuhun.yml
|
#- include: wuhun.yml
|
||||||
|
30
role/shanhai0625/tasks/ornaments.yml
Normal file
30
role/shanhai0625/tasks/ornaments.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: 下载 equip
|
||||||
|
local_action: subversion
|
||||||
|
args:
|
||||||
|
repo: "{{svn}}/shanhai0625/client/res/samejson/ornaments.json"
|
||||||
|
dest: "{{ansible_role_name}}/files/ornaments.json"
|
||||||
|
username: "{{username}}"
|
||||||
|
password: "{{password}}"
|
||||||
|
export: yes
|
||||||
|
force: yes
|
||||||
|
|
||||||
|
- name: 适配结构
|
||||||
|
local_action: shell
|
||||||
|
args:
|
||||||
|
chdir: "{{ansible_role_name}}/files/"
|
||||||
|
cmd: "python3 ornaments.py"
|
||||||
|
|
||||||
|
- name: 拷贝到gm
|
||||||
|
copy:
|
||||||
|
src: equip.json
|
||||||
|
dest: "{{gmdir}}/{{gmgame}}"
|
||||||
|
|
||||||
|
- name: 拷贝到gc
|
||||||
|
copy:
|
||||||
|
src: equip.json
|
||||||
|
dest: "{{gcdir}}/{{gmgame}}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user