From 100478d3a24d29ec65db39180e2c97b18ebc9d64 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 3 Oct 2019 23:14:53 +0800 Subject: [PATCH] =?UTF-8?q?build(init):=20=E5=A2=9E=E5=8A=A0=20CentOS=20?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E8=84=9A=E6=9C=AC=E4=BB=A5=E5=8F=8A=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=20init.sh=20=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BootstrapAdmin.sln | 9 +++++++++ init.sh | 16 ++++++++++++++++ scripts/ba.admin.service | 15 +++++++++++++++ scripts/ba.client.service | 15 +++++++++++++++ scripts/nginx.service | 16 ++++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 init.sh create mode 100644 scripts/ba.admin.service create mode 100644 scripts/ba.client.service create mode 100644 scripts/nginx.service diff --git a/BootstrapAdmin.sln b/BootstrapAdmin.sln index 3e928488..97f98578 100644 --- a/BootstrapAdmin.sln +++ b/BootstrapAdmin.sln @@ -112,6 +112,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ci", "ci", "{5F732D4E-133B- appveyor.yml = appveyor.yml EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "service", "service", "{68F7C160-3FB2-4129-8F89-96F78B2DA0A9}" + ProjectSection(SolutionItems) = preProject + scripts\ba.admin.service = scripts\ba.admin.service + scripts\ba.client.service = scripts\ba.client.service + init.sh = init.sh + scripts\nginx.service = scripts\nginx.service + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -168,6 +176,7 @@ Global {C6F2DCA0-7941-4C28-9328-2D495F5DCB00} = {72C103DB-E1D3-449F-97C2-DF12CA111FD4} {FDCFC3E3-14CF-40B2-9FE5-5BC239AAC110} = {72C103DB-E1D3-449F-97C2-DF12CA111FD4} {5F732D4E-133B-4DA6-811B-C369CDC3FB89} = {72C103DB-E1D3-449F-97C2-DF12CA111FD4} + {68F7C160-3FB2-4129-8F89-96F78B2DA0A9} = {72C103DB-E1D3-449F-97C2-DF12CA111FD4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {221EAE38-5F75-4391-9A48-E462A9F3B8FC} diff --git a/init.sh b/init.sh new file mode 100644 index 00000000..5cba7216 --- /dev/null +++ b/init.sh @@ -0,0 +1,16 @@ +#! /bin/bash + +mkdir /usr/local/ba +mkdir /usr/local/ba/admin +mkdir /usr/local/ba/client + +cd ~/ +git clone https://gitee.com/LongbowEnterprise/BootstrapAdmin.git + +cp ~/BootstrapAdmin/src/admin/Bootstrap.Admin/appsettings.json /usr/local/admin +cp ~/BootstrapAdmin/src/client/Bootstrap.Client/appsettings.json /usr/local/client + +cp * /usr/lib/systemd/system/ +systemctl enable ba.admin +systemctl enable ba.client +systemctl enable nginx diff --git a/scripts/ba.admin.service b/scripts/ba.admin.service new file mode 100644 index 00000000..4a34bb4d --- /dev/null +++ b/scripts/ba.admin.service @@ -0,0 +1,15 @@ +[Unit] +Description=Bootstrap Admin Application + +[Service] +Type=simple +WorkingDirectory=/usr/local/ba/admin +Environment=ASPNETCORE_ENVIRONMENT=Production +ExecStart=/usr/bin/dotnet Bootstrap.Admin.dll --urls http://localhost:50852 +ExecStop=/bin/kill -2 $MAINPID +KillMode=process +Restart=on-failure +RestartSec=1s + +[Install] +WantedBy=multi-user.target diff --git a/scripts/ba.client.service b/scripts/ba.client.service new file mode 100644 index 00000000..b74ca890 --- /dev/null +++ b/scripts/ba.client.service @@ -0,0 +1,15 @@ +[Unit] +Description=Bootstrap Client Application + +[Service] +Type=simple +WorkingDirectory=/usr/local/ba/client +Environment=ASPNETCORE_ENVIRONMENT=Production +ExecStart=/usr/bin/dotnet Bootstrap.Client.dll --urls http://localhost:49185 +ExecStop=/bin/kill -2 $MAINPID +KillMode=process +Restart=on-failure +RestartSec=1s + +[Install] +WantedBy=multi-user.target diff --git a/scripts/nginx.service b/scripts/nginx.service new file mode 100644 index 00000000..98e13b94 --- /dev/null +++ b/scripts/nginx.service @@ -0,0 +1,16 @@ +[Unit] +Description=nginx - high performance web server +Documentation=http://nginx.org/en/docs/ +After=network.target remote-fs.target nss-lookup.target + +[Service] +Type=forking +PIDFile=/usr/local/nginx/logs/nginx.pid +ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf +ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s QUIT $MAINPID +PrivateTmp=true + +[Install] +WantedBy=multi-user.target