nacos-config-quick.sh 1.84 KB
#!/bin/sh
echo "Nacos auto config started"

datasourceConfig=$(cat ../config/datasource-config.yaml)
storageConfig=$(cat ../config/project-storage.yaml)
accountConfig=$(cat ../config/project-account.yaml)
orderConfig=$(cat ../config/project-order.yaml)
gatewayConfig=$(cat ../config/project-gateway.yaml)
providerConfig=$(cat ../config/project-provider.yaml)
consumerConfig=$(cat ../config/project-consumer.yaml)
userConfig=$(cat ../config/project-user.yaml)
gisConfig=$(cat ../config/project-gis.yaml)
redisConfig=$(cat ../config/redis-config.yaml)
groupId="project"
curl -X POST "nacos-server:8848/nacos/v1/cs/configs" -d "dataId=datasource-config.yaml&group=${groupId}&content=${datasourceConfig}"
#curl -X POST "nacos-server:8848/nacos/v1/cs/configs" -d "dataId=project-storage.yaml&group=${groupId}&content=${storageConfig}"
#curl -X POST "nacos-server:8848/nacos/v1/cs/configs" -d "dataId=project-account.yaml&group=${groupId}&content=${accountConfig}"
curl -X POST "nacos-server:8848/nacos/v1/cs/configs" -d "dataId=project-order.yaml&group=${groupId}&content=${orderConfig}"
curl -X POST "nacos-server:8848/nacos/v1/cs/configs" -d "dataId=project-gateway.yaml&group=${groupId}&content=${gatewayConfig}"
#curl -X POST "nacos-server:8848/nacos/v1/cs/configs" -d "dataId=project-provider.yaml&group=${groupId}&content=${providerConfig}"
#curl -X POST "nacos-server:8848/nacos/v1/cs/configs" -d "dataId=project-consumer.yaml&group=${groupId}&content=${consumerConfig}"
curl -X POST "nacos-server:8848/nacos/v1/cs/configs" -d "dataId=project-user.yaml&group=${groupId}&content=${userConfig}"
curl -X POST "nacos-server:8848/nacos/v1/cs/configs" -d "dataId=project-gis.yaml&group=${groupId}&content=${gisConfig}"
curl -X POST "nacos-server:8848/nacos/v1/cs/configs" -d "dataId=redis-config.yaml&group=${groupId}&content=${redisConfig}"
echo "Nacos config pushed successfully finished"