Mark Ku's Blog
首頁 關於我
Reduce the risk of manual deployment using powershell and beyondcompare
PowerShell
Reduce the risk of manual deployment using powershell and beyondcompare
Mark Ku
Mark Ku
June 27, 2023
1 min

Purpose

To reduce the time spent and human error on manual deployment, the deployment method for the C# API has been changed.

Deploy flow

Firstly, all deployment DLLs must be committed to ApiArtifact, which can be accessed by navigating to the Publish folder at

https://github.com/XyzCom/ApiArtifact.

Next, connect remotely to server and right-click deploy-api.ps1 on the desktop and select “Run with PowerShell”. This will pull down the latest DLLs.

Select the DLLs to be deployed, and then manually click “Copy to Side ” folder as shown in the image below.

Create ApiArtifact repo and git clone in deploy server ( And always upload all )

(https://i.imgur.com/tFZbusd.png)

create powershell file ( compare-deploy-binaray.ps1 )

git pull 

$LOCAL = "C:\Workspace\ApiArtifact\bin"
$REMOTE = "C:\inetpub\Web\bin"

$env:Path = "C:\Program Files\Beyond Compare 4\" 
$filters = "/filters=-web.config"
BCompare.exe /excludefilter="web.config"  "$LOCAL" "$REMOTE" $filters

Result


Tags

Mark Ku

Mark Ku

Software Developer

9年以上豐富網站開發經驗,開發過各種網站,電子商務、平台網站、直播系統、POS系統、SEO 優化、金流串接、AI 串接,Infra 出身,帶過幾次團隊,也加入過大團隊一起開發。

Expertise

前端(React)
後端(C#)
網路管理
DevOps
溝通
領導

Social Media

facebook github website

Related Posts

Powershell 一鍵產生 git 所需的 ssh & 並將 ssh 上傳 github & git clone repo
Powershell 一鍵產生 git 所需的 ssh & 並將 ssh 上傳 github & git clone repo
May 31, 2023
1 min

Quick Links

關於我

Social Media