forked from olegabu/fabric-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
host-create.sh
executable file
·38 lines (26 loc) · 1.08 KB
/
host-create.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
#!/usr/bin/env bash
source lib/util/util.sh
source lib.sh
setDocker_LocalRegistryEnv
if [ -n "$DOCKER_REGISTRY" ]; then
DOCKER_MACHINE_FLAGS="${DOCKER_MACHINE_FLAGS} --engine-insecure-registry $DOCKER_REGISTRY "
fi
info "Create Network with vm names prefix: $VM_NAME_PREFIX"
#read -n1 -r -p "Press any key to continue..." key
: ${DOMAIN:=example.com}
declare -a ORGS_MAP=${@:-org1}
orgs=`parseOrganizationsForDockerMachine ${ORGS_MAP}`
first_org=${orgs%% *}
# Create orderer host machine
##ordererMachineName="orderer.$DOMAIN"
##info "Creating $ordererMachineName, Options: $DOCKER_MACHINE_FLAGS"
##docker-machine rm ${ordererMachineName} --force
##docker-machine create ${DOCKER_MACHINE_FLAGS} ${ordererMachineName}
# Create member organizations host machines
for org in ${orgs}
do
orgMachineName=`getDockerMachineName $org`
info "Creating member organization $org on machine: $orgMachineName with flags: $DOCKER_MACHINE_FLAGS"
[[ -z `getHostOrgForOrg $org` ]] && docker-machine rm ${orgMachineName} --force
docker-machine create ${DOCKER_MACHINE_FLAGS} ${orgMachineName}
done