forked from dotnetcore/WTM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
59 lines (48 loc) · 2.68 KB
/
deploy.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# 问题1
# Failed to load ▒▒, error: libunwind.so.8: cannot open shared object file: No such file or directory
# Failed to bind to CoreCLR at '/websites/walkingtec.mvvm.mvc.admin/libcoreclr.so'
# yum install libunwind
# 问题2
# FailFast: Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
#
# at System.Environment.FailFast(System.String)
# at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
# at System.Globalization.GlobalizationMode..cctor()
# at System.Globalization.CultureData.CreateCultureWithInvariantData()
# at System.Globalization.CultureData.get_Invariant()
# at System.Globalization.CultureData.GetCultureData(System.String, Boolean)
# at System.Globalization.CultureInfo.InitializeFromName(System.String, Boolean)
# at System.Globalization.CultureInfo.Init()
# at System.Globalization.CultureInfo..cctor()
# at System.StringComparer..cctor()
# at System.AppDomainSetup.SetCompatibilitySwitches(System.Collections.Generic.IEnumerable`1<System.String>)
# at System.AppDomain.PrepareDataForSetup(System.String, System.AppDomainSetup, System.Security.Policy.Evidence, System.Security.Polic y.Evidence, IntPtr, System.String, System.String[], System.String[])
# Aborted
# yum install icu
# clean
rm -rf ./.Publish
rm -rf walkingtec.mvvm.mvc.admin.tar.gz
# 编译并发布
# dotnet publish "./WalkingTec.Mvvm.Mvc.Admin/WalkingTec.Mvvm.Mvc.Admin.csproj" -c Release -r centos.7-x64 -f netcoreapp2.0 -o "../.Publish"
"C:/Program Files/dotnet/dotnet.exe" publish "./WalkingTec.Mvvm.Mvc.Admin/WalkingTec.Mvvm.Mvc.Admin.csproj" -c Release -r centos.7-x64 -f netcoreapp2.0 -o "../.Publish"
# 打包
cd .Publish/ && tar -zcf ../walkingtec.mvvm.mvc.admin.tar.gz *
cd ../
# 创建指定目录
ssh [email protected] "mkdir -p /websites/walkingtec.mvvm.mvc.admin"
# 停止站点
# TODO
# 发布
# pscp -i ./id_rsa.ppk -r ./.Publish/* [email protected]:/websites/walkingtec.mvvm.mvc.admin
# scp -r ./.Publish/* [email protected]:/websites/walkingtec.mvvm.mvc.admin
scp -r ./walkingtec.mvvm.mvc.admin.tar.gz [email protected]:/websites/walkingtec.mvvm.mvc.admin.tar.gz
# 解压
ssh [email protected] "tar -xzf /websites/walkingtec.mvvm.mvc.admin.tar.gz -C /websites/walkingtec.mvvm.mvc.admin"
# 授予执行权限
ssh [email protected] "chmod 777 /websites/walkingtec.mvvm.mvc.admin/WalkingTec.Mvvm.Mvc.Admin"
# 启动站点
ssh [email protected] "kill -9 $(pidof WalkingTec.Mvvm.Mvc.Admin)"
ssh [email protected] "/websites/walkingtec.mvvm.mvc.admin/WalkingTec.Mvvm.Mvc.Admin"
# clean
rm -rf ./.Publish
rm -rf walkingtec.mvvm.mvc.admin.tar.gz