我正在尝试按照本教程进行操作,但是找不到install.sh文件。
如何生成文件?还是如果它是由Microsoft创建的,我在哪里可以找到它?
答案 0 :(得分:0)
通过您链接的docs:
使用模板中提供的安装脚本将应用程序包复制到群集的映像存储中,注册应用程序类型并创建该应用程序的实例。
Yeoman模板应该在根文件夹中生成一个名为install.sh
的bash脚本和|或一个名为install.ps1
的powershell脚本,如果不生成,则无论如何都可能出现了问题您可以从其中一个演示中复制脚本:
Services/CounterService/install.sh
#!/bin/bash
create_app()
{
sfctl application create --app-name fabric:/CounterServiceApplication --app-type CounterServiceApplicationType --app-version 1.0.0 --parameters $1
}
print_help()
{
echo "Additional Options"
echo "-onebox (Default): If you are deploying application on one box cluster"
echo "-multinode: If you are deploying application on a multi node cluster"
}
if [ "$1" = "--help" ]
then
print_help
exit 0
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
appPkg="$DIR/CounterServiceApplication"
WebServiceManifestlocation="$appPkg/CounterServiceWebServicePkg"
WebServiceManifestlocationLinux="$WebServiceManifestlocation/ServiceManifest-Linux.xml"
WebServiceManifestlocationWindows="$WebServiceManifestlocation/ServiceManifest-Windows.xml"
WebServiceManifestlocation="$WebServiceManifestlocation/ServiceManifest.xml"
cp $WebServiceManifestlocationLinux $WebServiceManifestlocation
StatefulServiceManifestlocation="$appPkg/CounterServicePkg"
StatefulServiceManifestlocationLinux="$StatefulServiceManifestlocation/ServiceManifest-Linux.xml"
StatefulServiceManifestlocationWindows="$StatefulServiceManifestlocation/ServiceManifest-Windows.xml"
StatefulServiceManifestlocation="$StatefulServiceManifestlocation/ServiceManifest.xml"
cp $StatefulServiceManifestlocationLinux $StatefulServiceManifestlocation
cp dotnet-include.sh ./CounterServiceApplication/CounterServicePkg/Code
cp dotnet-include.sh ./CounterServiceApplication/CounterServiceWebServicePkg/Code
sfctl application upload --path CounterServiceApplication --show-progress
sfctl application provision --application-type-build-path CounterServiceApplication
if [ $# -eq 0 ]
then
echo "No arguments supplied, proceed with default instanceCount of 1"
create_app "{\"CounterServiceWebService_InstanceCount\":\"1\"}"
elif [ $1 = "-onebox" ]
then
echo "Onebox environment, proceed with default instanceCount of 1."
create_app "{\"CounterServiceWebService_InstanceCount\":\"1\"}"
elif [ $1 = "-multinode" ]
then
echo "Multinode env, proceed with default instanceCount of -1"
create_app {}
fi
将CounterService
替换为您的应用名称