-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·62 lines (55 loc) · 2.13 KB
/
setup.sh
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
#!/bin/bash
# Setup Script for hedera-gcs-setup
mkdir -pv ~/Desktop/hedera-mirror-node/vars ~/Desktop/hedera-mirror-node/roles
touch ~/Desktop/hedera-mirror-node/inventory.ini
cat >> ~/Desktop/hedera-mirror-node/inventory.ini <<- _EOF_
[mirrornode]
IPADDRESS ansible_ssh_user=USERNAME
_EOF_
touch ~/Desktop/hedera-mirror-node/roles/requirements.yml
cat >> ~/Desktop/hedera-mirror-node/roles/requirements.yml <<- _EOF_
---
# from github
- src: https://github.com/injectedfusion/hedera-gcs-setup
...
_EOF_
touch ~/Desktop/hedera-mirror-node/vars/project-id.json
cat >> ~/Desktop/hedera-mirror-node/vars/project-id.json <<- _EOF_
{
"access_key":"GOOG1E...",
"secret_key":"H/4...",
"project_id":"Your-Google-Project-ID"
}
_EOF_
touch ~/Desktop/hedera-mirror-node/server_build.yml
cat >> ~/Desktop/hedera-mirror-node/server_build.yml <<- _EOF_
---
- hosts: mirrornode
vars_files:
- ./vars/project-id.json
roles:
- hedera-gcs-setup
...
_EOF_
# Install Ansible Role
ansible-galaxy install -r ~/Desktop/hedera-mirror-node/roles/requirements.yml --force
touch ~/Desktop/hedera-mirror-node/install_services.sh
cat >> ~/Desktop/hedera-mirror-node/install_services.sh <<- _EOF_
#!/bin/bash
ansible-playbook -i ~/Desktop/hedera-mirror-node/inventory.ini ~/Desktop/hedera-mirror-node/server_build.yml --tags "install"
_EOF_
touch ~/Desktop/hedera-mirror-node/start_services.sh
cat >> ~/Desktop/hedera-mirror-node/start_services.sh <<- _EOF_
#!/bin/bash
ansible-playbook -i ~/Desktop/hedera-mirror-node/inventory.ini ~/Desktop/hedera-mirror-node/server_build.yml --tags "start_services"
_EOF_
touch ~/Desktop/hedera-mirror-node/stop_services.sh
cat >> ~/Desktop/hedera-mirror-node/stop_services.sh <<- _EOF_
#!/bin/bash
ansible-playbook -i ~/Desktop/hedera-mirror-node/inventory.ini ~/Desktop/hedera-mirror-node/server_build.yml --tags "stop_services"
_EOF_
chmod +x ~/Desktop/hedera-mirror-node/install_services.sh
chmod +x ~/Desktop/hedera-mirror-node/start_services.sh
chmod +x ~/Desktop/hedera-mirror-node/stop_services.sh
echo "Project Directory Established"
echo "Now go update hedera-mirror-node/inventory.ini and hedera-mirror-node/vars/project-id.json"