client_secret.json 是機敏資料, 不可以放入版本控制, 需要特殊的流程步驟上傳到你的 Web Server 的位置 - Openshift 可以透過 SSH 或是 SFTP 登入來上傳client_secret.json - CI 以 JENKINS 為例 ; 可以使用 Publish over SSH 上傳檔案 - 需要注意 CI Server 要有 Web Server 的 SSH Key - LINUX 複製資料夾語法 cp -rf src/folder/. target/folder
publicstaticvoidCreateCounters() { CounterCreationDataCollection col = new CounterCreationDataCollection();
// Create custom counter objects CounterCreationData counter1 = new CounterCreationData(); counter1.CounterName = "Available Worker Threads"; counter1.CounterHelp = "The difference between the maximum number " + "of thread pool worker threads and the " + "number currently active."; counter1.CounterType = PerformanceCounterType.NumberOfItems32;
CounterCreationData counter2 = new CounterCreationData(); counter2.CounterName = "Available IO Threads"; counter2.CounterHelp = "The difference between the maximum number of " + "thread pool IO threads and the number "+ "currently active."; counter2.CounterType = PerformanceCounterType.NumberOfItems32;
CounterCreationData counter3 = new CounterCreationData(); counter3.CounterName = "Max Worker Threads"; counter3.CounterHelp = "The number of requests to the thread pool "+ "that can be active concurrently. All "+ "requests above that number remain queued until " + "thread pool worker threads become available."; counter3.CounterType = PerformanceCounterType.NumberOfItems32;
CounterCreationData counter4 = new CounterCreationData(); counter4.CounterName = "Max IO Threads"; counter4.CounterHelp = "The number of requests to the thread pool " + "that can be active concurrently. All "+ "requests above that number remain queued until " + "thread pool IO threads become available."; counter4.CounterType = PerformanceCounterType.NumberOfItems32;
// Add custom counter objects to CounterCreationDataCollection. col.Add(counter1); col.Add(counter2); col.Add(counter3); col.Add(counter4); // delete the category if it already exists if(PerformanceCounterCategory.Exists("MyAspNetThreadCounters")) { PerformanceCounterCategory.Delete("MyAspNetThreadCounters"); } // bind the counters to the PerformanceCounterCategory PerformanceCounterCategory category = PerformanceCounterCategory.Create("MyAspNetThreadCounters", "", col); } }
額外處理事項: 直接在 Jenkins server 發 pr 給 openshift 時,發生 503 錯誤。 使用 ssh 登入 openshift 看 log ,發現 Node Sass does not yet support your current environment 錯誤 必須登入執行以下語法修正模組問題 npm rebuild node-sass
建置作業,會得到錯誤訊息
1 2 3 4
上略... 19:44:46 Host key verification failed. 19:44:46 fatal: Could not read from remote repository. 下略...
原因:主機密鑰驗證失敗,這個錯誤的意思是我的 Jenkins Server 主機並不認得遠端的 Openshift Server 的 host key,主要的原因是 Jenkins Service 在執行的身份是 NT AUTHORITY\SYSTEM,由於我已經有合適權限的帳號,所以只需要切換執行 Jenkins Server 的身份即可。