1.先取得crumb(也就是token)
透過http Get 方法,透過base 認證取得內容內容,將
2.將jenkins作業的url貼上,並以POST方式,並將crumbRequestField與crumb內容帶入http Header就可以呼叫
3.若作業有參數必須將Build參數改為BuildWithParameters,再將參數的變數使用querystring帶入即可
請參考:Crontab.guru – The cron schedule expression editor
在unix都是透過cron方式進行排程,所以只要在以上網址可以直接輸入要的排程時間,然後將結果複製就可以了。
以下是範例是每天凌晨1:00執行。
以下是每小時整點
參考:Cron examples – Crontab.guru
參考以上網址有很多範例可以參考
openssl x509 -outform der -in certificate.pem -out certificate.der
openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt
openssl x509 -inform der -in certificate.cer -out certificate.pem
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer
openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer
openssl pkcs12 -in certificate.pfx -out certificate.cer -nodes
參考RSA 金鑰對Web.config資料庫連線字串加密 – Program – Medium
1.建立RSA金鑰 並將金鑰匯出成檔案
set framework_path=C:\Windows\Microsoft.NET\Framework\v2.0.50727 %framework_path%\aspnet_regiis.exe -pc “SBPKeys" –exp(產生金鑰並註冊) |
Web.config加入configProtectedData
<?xml version="1.0″ encoding="utf-8″?> : : <configProtectedData defaultProvider="SBPProtectedProvider"> |
2.對 Web.config 連線字串與appsetting內容加密
set ap=sbpclient.exe |
3.授權使用RSA金鑰
set framework_path=C:\Windows\Microsoft.NET\Framework\v2.0.50727 %framework_path%\aspnet_regiis.exe -pi “SBPKeys" SBPkeys.xml(匯入金鑰,將步驟1產生的檔案複製到另一台,若同一台不需要執行匯入) |
加密後結果
參考:Send-MailMessage (Microsoft.PowerShell.Utility) – PowerShell | Microsoft Learn
Send-MailMessage -From ‘f25b-server@systex.com.tw’ -To ‘ccyeh@systex.com.tw’ -Subject ‘Sending the test’ -Body “body. Sending now." -SmtpServer ‘mail.xxx.xx’ -UseSsl -Credential ccyeh@systex.com.tw
透過以上語法執行後系統會提示輸入密碼後就可以寄發了
參考:
1.GitHub – EvotecIT/Transferetto: Small PowerShell module with FTPS/SFTP functionality
2.Easy way to connect to FTPS and SFTP using PowerShell – Evotec
1.首先先安裝Transferetto Module
Install-Module -Name Transferetto -AllowClobber –Force
2.使用Connect-Ftp連到Server
3.使用Get-FTPList取得清單
範例如下: