Fixed volume mount issue
This commit is contained in:
4
install/.gitignore
vendored
4
install/.gitignore
vendored
@@ -7,5 +7,5 @@ protocol-server-data/bap-network.yml
|
|||||||
protocol-server-data/bpp-client.yml
|
protocol-server-data/bpp-client.yml
|
||||||
protocol-server-data/bpp-network.yml
|
protocol-server-data/bpp-network.yml
|
||||||
ENV/.env-generic-client-layer
|
ENV/.env-generic-client-layer
|
||||||
registry.lock*
|
registry.*db
|
||||||
gateway.lock*
|
gateway.*db
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ update_registry_details() {
|
|||||||
tmp_file=$(mktemp "tempfile.XXXXXXXXXX")
|
tmp_file=$(mktemp "tempfile.XXXXXXXXXX")
|
||||||
sed "s|REGISTRY_URL|$registry_url|g; s|REGISTRY_PORT|$registry_port|g; s|PROTOCOL|$protocol|g" "$config_file" > "$tmp_file"
|
sed "s|REGISTRY_URL|$registry_url|g; s|REGISTRY_PORT|$registry_port|g; s|PROTOCOL|$protocol|g" "$config_file" > "$tmp_file"
|
||||||
mv "$tmp_file" "$config_file"
|
mv "$tmp_file" "$config_file"
|
||||||
|
docker volume create registry_data_volume
|
||||||
|
docker run --rm -v $SCRIPT_DIR/../registry_data/config:/source -v registry_data_volume:/target busybox cp /source/{envvars,logger.properties,swf.properties} /target/
|
||||||
|
docker volume create registry_database_volume
|
||||||
|
docker run --rm -v $SCRIPT_DIR/../registry_data/database:/source -v registry_database_volume:/target busybox cp /source/db.txt /target/db.txt
|
||||||
|
|
||||||
}
|
}
|
||||||
# Function to start the MongoDB, Redis, and RabbitMQ Services
|
# Function to start the MongoDB, Redis, and RabbitMQ Services
|
||||||
@@ -77,11 +81,11 @@ install_gateway() {
|
|||||||
echo "Registering Gateway in the registry"
|
echo "Registering Gateway in the registry"
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
if [[ $1 && $2 ]]; then
|
# if [[ $1 && $2 ]]; then
|
||||||
bash scripts/register_gateway.sh $2
|
# bash scripts/register_gateway.sh $2
|
||||||
else
|
# else
|
||||||
bash scripts/register_gateway.sh
|
# bash scripts/register_gateway.sh
|
||||||
fi
|
# fi
|
||||||
echo " "
|
echo " "
|
||||||
echo "Gateway installation successful"
|
echo "Gateway installation successful"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ services:
|
|||||||
- 3030:3030
|
- 3030:3030
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./registry_data/config/swf.properties:/registry/overrideProperties/config/swf.properties
|
- registry_data_volume:/registry/overrideProperties/config
|
||||||
- ./registry_data/database:/registry/database
|
- registry_data_volume:/registry/database
|
||||||
|
|
||||||
gateway:
|
gateway:
|
||||||
image: fidedocker/gateway
|
image: fidedocker/gateway
|
||||||
@@ -24,9 +24,8 @@ services:
|
|||||||
- 4030:4030
|
- 4030:4030
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./gateway_data/config/swf.properties:/gateway/overrideProperties/config/swf.properties
|
- gateway_data_volume:/gateway/overrideProperties/config
|
||||||
- ./gateway_data/config/networks:/gateway/overrideProperties/config/networks #Update varibales post demo
|
- gateway_database_volume:/gateway/database
|
||||||
- ./gateway_data/database:/gateway/database
|
|
||||||
|
|
||||||
bap-client:
|
bap-client:
|
||||||
image: fidedocker/protocol-server
|
image: fidedocker/protocol-server
|
||||||
@@ -109,3 +108,13 @@ networks:
|
|||||||
beckn_network:
|
beckn_network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
registry_data_volume:
|
||||||
|
name: registry_data_volume
|
||||||
|
registry_database_volume:
|
||||||
|
name: registry_database_volume
|
||||||
|
gateway_data_volume:
|
||||||
|
name: gateway_data_volume
|
||||||
|
gateway_database_volume:
|
||||||
|
name: gateway_database_volume
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"core_version" : "1.1.0",
|
"core_version" : "1.1.0",
|
||||||
"registry_id": "registry-energy.becknprotocol.io..LREG",
|
"registry_id": "registry-dev.becknprotocol.io..LREG",
|
||||||
"search_provider_id" : "gateway-energy.becknprotocol.io",
|
"search_provider_id" : "gateway-dev.becknprotocol.io",
|
||||||
"self_registration_supported": true,
|
"self_registration_supported": true,
|
||||||
"subscription_needed_post_registration" : true,
|
"subscription_needed_post_registration" : true,
|
||||||
"base_url": "https://registry-energy.becknprotocol.io",
|
"base_url": "https://registry-dev.becknprotocol.io",
|
||||||
"registry_url" : "https://registry-energy.becknprotocol.io/subscribers",
|
"registry_url" : "https://registry-dev.becknprotocol.io/subscribers",
|
||||||
"extension_package": "in.succinct.beckn.boc",
|
"extension_package": "in.succinct.beckn.boc",
|
||||||
"wild_card" : ""
|
"wild_card" : ""
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,7 @@ update_network_json(){
|
|||||||
tmp_file=$(mktemp "tempfile.XXXXXXXXXX")
|
tmp_file=$(mktemp "tempfile.XXXXXXXXXX")
|
||||||
sed " s|GATEWAY_ID|$gateway_id|g; s|REGISTRY_ID|$registry_id|g; s|REGISTRY_URL|$registry_url|g" "$networks_config_file" > "$tmp_file"
|
sed " s|GATEWAY_ID|$gateway_id|g; s|REGISTRY_ID|$registry_id|g; s|REGISTRY_URL|$registry_url|g" "$networks_config_file" > "$tmp_file"
|
||||||
mv "$tmp_file" "$networks_config_file"
|
mv "$tmp_file" "$networks_config_file"
|
||||||
|
docker run --rm -v $SCRIPT_DIR/../gateway_data/config:/source -v gateway_data_volume:/target busybox cp -r /source/networks /target/
|
||||||
}
|
}
|
||||||
|
|
||||||
get_details_registry() {
|
get_details_registry() {
|
||||||
@@ -38,9 +39,9 @@ get_details_registry() {
|
|||||||
|
|
||||||
update_gateway_config() {
|
update_gateway_config() {
|
||||||
# Print the extracted keys
|
# Print the extracted keys
|
||||||
echo "Signing Public Key: $signing_public_key"
|
# echo "Signing Public Key: $signing_public_key"
|
||||||
echo "Encryption Public Key: $encr_public_key"
|
# echo "Encryption Public Key: $encr_public_key"
|
||||||
echo "URL $subscriber_url"
|
# echo "URL $subscriber_url"
|
||||||
|
|
||||||
cp $SCRIPT_DIR/../gateway_data/config/swf.properties-sample $SCRIPT_DIR/../gateway_data/config/swf.properties
|
cp $SCRIPT_DIR/../gateway_data/config/swf.properties-sample $SCRIPT_DIR/../gateway_data/config/swf.properties
|
||||||
config_file="$SCRIPT_DIR/../gateway_data/config/swf.properties"
|
config_file="$SCRIPT_DIR/../gateway_data/config/swf.properties"
|
||||||
@@ -49,7 +50,12 @@ update_gateway_config() {
|
|||||||
#sed " s|SUBSCRIBER_ID|$gateway_id|g; s|SIGNING_PUBLIC_KEY|$signing_public_key|g; s|ENCRYPTION_PUBLIC_KEY|$encr_public_key|g; s|GATEWAY_URL|$gateway_id|g; s|GATEWAY_PORT|$gateway_port|g; s|PROTOCOL|$protocol|g; s|REGISTRY_URL|$subscriber_url|g" "$config_file" > "$tmp_file"
|
#sed " s|SUBSCRIBER_ID|$gateway_id|g; s|SIGNING_PUBLIC_KEY|$signing_public_key|g; s|ENCRYPTION_PUBLIC_KEY|$encr_public_key|g; s|GATEWAY_URL|$gateway_id|g; s|GATEWAY_PORT|$gateway_port|g; s|PROTOCOL|$protocol|g; s|REGISTRY_URL|$subscriber_url|g" "$config_file" > "$tmp_file"
|
||||||
sed " s|SUBSCRIBER_ID|$gateway_id|g; s|GATEWAY_URL|$gateway_id|g; s|GATEWAY_PORT|$gateway_port|g; s|PROTOCOL|$protocol|g; s|REGISTRY_URL|$subscriber_url|g" "$config_file" > "$tmp_file"
|
sed " s|SUBSCRIBER_ID|$gateway_id|g; s|GATEWAY_URL|$gateway_id|g; s|GATEWAY_PORT|$gateway_port|g; s|PROTOCOL|$protocol|g; s|REGISTRY_URL|$subscriber_url|g" "$config_file" > "$tmp_file"
|
||||||
mv "$tmp_file" "$config_file"
|
mv "$tmp_file" "$config_file"
|
||||||
|
docker volume create gateway_data_volume
|
||||||
|
docker volume create gateway_database_volume
|
||||||
|
docker run --rm -v $SCRIPT_DIR/../gateway_data/config:/source -v gateway_data_volume:/target busybox cp /source/{envvars,logger.properties,swf.properties} /target/
|
||||||
|
docker run --rm -v $SCRIPT_DIR/../registry_data/database:/source -v gateway_database_volume:/target busybox cp /source/db.txt /target/db.txt
|
||||||
update_network_json
|
update_network_json
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# if [[ $1 == https://* ]]; then
|
# if [[ $1 == https://* ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user