-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_muta.yml
87 lines (78 loc) · 2.7 KB
/
build_muta.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
- hosts: muta_build
gather_facts: no
become: yes
become_method: sudo
vars_files:
- roles/muta/vars/main.yaml
tasks:
- name: git clone {{ chain_type }} code
git:
repo: "{{ code_repo }}"
dest: "{{ muta_code_dir }}"
version: "{{ muta_branch }}"
force: yes
update: yes
register: gitresult
- set_fact: muta_version="{{ gitresult.after[:7] }}"
- name: git clone muta-keypair code
git:
repo: "https://github.com/nervosnetwork/muta.git"
dest: "{{ muta_keypair_code_dir }}"
version: "master"
force: yes
update: yes
when: chain_type == "huobi"
- name: build huobi-chain binary
shell: docker run -i \
-w=/tmp/muta \
--rm \
-v {{ muta_code_dir }}:/tmp/muta \
--name=build_muta_{{ muta_version }} \
--privileged=true \
jiangxianliang/muta-build:latest \
bash -c "cargo build --release"
when: chain_type == "huobi"
- name: build muta-keypair binary
shell: docker run -i \
-w=/tmp/muta \
--rm \
-v {{ muta_keypair_code_dir }}:/tmp/muta \
--name=build_muta_keypair_{{ muta_version }} \
--privileged=true \
jiangxianliang/muta-build:latest \
bash -c "cd ./devtools/keypair && cargo build --release"
when: chain_type == "huobi"
- name: build muta-chain binary
shell: docker run -i \
-w=/tmp/muta \
--rm \
-v {{ muta_code_dir }}:/tmp/muta \
--name=build_muta_{{ muta_version }} \
--privileged=true \
jiangxianliang/muta-build:latest \
bash -c "cargo build --release --example muta-chain && cd ./devtools/keypair && cargo build --release"
when: chain_type == "muta"
- name: fetch muta-chain
fetch:
src: "{{ muta_code_dir }}/target/release/examples/muta-chain"
dest: ./roles/muta/files/muta-chain
flat: yes
when: chain_type == "muta"
- name: fetch huobi-chain
fetch:
src: "{{ muta_code_dir }}/target/release/huobi-chain"
dest: ./roles/muta/files/huobi-chain
flat: yes
when: chain_type == "huobi"
- name: fetch muta-keypair
fetch:
src: "{{ muta_code_dir }}/target/release/muta-keypair"
dest: ./roles/muta/files/muta-keypair
flat: yes
when: chain_type == "muta"
- name: fetch muta-keypair to huobi
fetch:
src: "{{ muta_keypair_code_dir }}/target/release/muta-keypair"
dest: ./roles/muta/files/muta-keypair
flat: yes
when: chain_type == "huobi"