Skip to content

Commit

Permalink
Merge pull request #43 from bityoga/config_auto_install_of_bank_chain…
Browse files Browse the repository at this point in the history
…code_in_cli

 Added configuration to auto install articonf bank chaincode along with the CLI service
  • Loading branch information
anandhakumarpalanisamy committed Oct 15, 2020
2 parents c4646e1 + c842881 commit 7b6336f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
LOG_LEVEL: "INFO"
INSTALL_BANK_CHAINCODE: "y"
###########################################################################################
# #
# #
Expand Down
11 changes: 11 additions & 0 deletions roles/hlf/cli/cli/files/CLI.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

#!/bin/bash
set -x #echo on
if [ $INSTALL_BANK_CHAINCODE == "y" ]; then
git clone https://github.com/bityoga/articonf-bank-chaincode.git /root/CLI/chaincodes/articonf-bank-chaincode &&
bash /root/CLI/chaincodes/articonf-bank-chaincode/bank_chaincode/shell_scripts_v2/install.sh &&
bash /root/CLI/chaincodes/articonf-bank-chaincode/bank_chaincode/shell_scripts_v2/instantiate.sh &&
while true; do sleep 2; done;
else
while true; do sleep 2; done;
fi
11 changes: 10 additions & 1 deletion roles/hlf/cli/cli/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@
src: "test_chaincode/"
dest: "/root/hlft-store/chaincodes/test_chaincode"
mode: 0750

- name: Copy CLI script
become: yes
copy:
src: "CLI.sh"
dest: "/root/hlft-store/CLI.sh"
mode: "0500"
force: yes

# Create & Start service for CLI
- name: Fabric Service - {{ item.name }}
Expand All @@ -26,7 +34,7 @@
- "{{swarm_network}}"
image: "{{cli.image}}:{{cli.tag}}"
command: >
bash -c "while true; do sleep 2; done;"
bash -c "/root/CLI/CLI.sh"
working_dir: /root/CLI
mounts:
- source: "/root/hlft-store"
Expand All @@ -41,6 +49,7 @@
- "ADMIN_USER={{admin_user}}"
- "TLSCA_HOST={{tlsca.name}}"
- "ORGCA_HOST={{orgca.name}}"
- "INSTALL_BANK_CHAINCODE={{INSTALL_BANK_CHAINCODE}}"
placement:
constraints:
- node.role == worker
Expand Down

0 comments on commit 7b6336f

Please sign in to comment.