コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Jenkins】リポジトリ : Error performing git command: git.ext ls-remote -h XXXX.git HEAD との接続に失敗しました。

概要 リポジトリ : Error performing git command: git.ext ls-remote -h XXXX.git HEAD との接続に失敗しました。 Jenkins で Git のリポジトリ URL を指定した時に 上記のエラーが発生する現象に遭遇した 「Jenkinsの管理 > Global Tool Configuration」を…

【Jenkins】変更がある場合にのみ git commit する方法

参考サイト様 その1 git diff --quiet && git diff --staged --quiet || git commit -am 'XXXX' その2 git commit -m "XXXX" || echo "No changes to commit"

【Jenkins】ビルド日時の環境変数を使用できる「Build Timestamp」紹介

はじめに 「Build Timestamp」を Jenkins に追加することで ビルド日時の環境変数を使用できるようになります 使用例 pipeline { agent any stages { stage('Initialize') { steps { script { echo "${BUILD_TIMESTAMP}" echo "${env.BUILD_TIMESTAMP}" } } …

【Jenkins】Homebrew でインストールした Jenkins を起動したりアップデートしたりするコマンド

概要 # LTS のインストール brew install jenkins-lts # 特定のバージョンの LTS のインストール brew install jenkins-lts@YOUR_VERSION # 起動 brew services start jenkins-lts # 再起動 brew services restart jenkins-lts # アップデート brew upgrade …

【Jenkins】io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 500 Internal Server Error:

概要 io.jenkins.plugins.appcenter.AppCenterException: Upload app to resource unsuccessful: HTTP 500 Internal Server Error: {"error":{"code":500,"message":"Unable to load one or more of the requested types. Retrieve the LoaderExceptions pro…

【Jenkins】currentBuild.description で改行する方法

概要 stage( "【ステージ名】" ){ steps { script{ currentBuild.description = "aaa<br>bbb<br>ccc" } } } <br> を使用する 参考サイト様

【Jenkins】WorkflowScript: XX: Duplicate stage name: "YYYY" @ line XX, column ZZ.

概要 WorkflowScript: XX: Duplicate stage name: "YYYY" @ line XX, column ZZ. 同名の stage が複数存在する場合に発生するエラー

【Jenkins】ビルド履歴にビルドに使用したブランチ名などを表示する方法

概要 stage( "【ステージ名】" ){ steps { script{ currentBuild.description = "【ビルド履歴に表示する文字列】" } } } currentBuild.description を使用する 改行したい時は \n ではなく <br> を使用する 参考サイト様

【Jenkins】java.net.SocketTimeoutException: connect timed out

概要 java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToA…

【Jenkins】ジョブの設定がうまくいかない時にログを確認する方法

概要 「Jenkinsの管理」を押して 「システムログ」を押して 「すべてのログ」を押すことで Jenkins のログを確認することができるので どうしてもジョブの設定がうまくいかない場合はここを参考にする 参考サイト様

【Jenkins】ビルドキューに存在するすべてのジョブのビルドを停止する方法

概要 def q = Jenkins.instance.queue q.items.findAll { q.cancel(it.task) } 「Jenkinsの管理 > スクリプトコンソール」を開いて上記のコードを入力して 「実行」を押す 参考サイト様

【Jenkins】GitHub Pull Request Builder の結果がプルリクに表示される時の表示名を「default」以外にする方法

概要 Jenkins のジョブの設定画面の 「ビルド・トリガ > GitHub Pull Request Builder > 高度な設定 > Trigger Setup」 を開いて 「Commit Status Context」に表示名を設定する 参考サイト様

【Jenkins】Unity Test Runner の結果を NUnit plugin で表示すると日本語が文字化けする場合

概要 Unity Test Runner の結果を NUnit plugin で表示したところ、 日本語が ? で表示されてしまう状況に遭遇した Jenkins の NUnit plugin を 0.26 から 0.27 にアップデートして 再度 Unity Test Runner を実行してみたところ 日本語が正常に表示されるよ…

【Jenkins】GitHub のプルリクをトリガーにジョブをビルドする方法

目次 目次 検証環境 GitHub Pull Request Builder プラグインのインストール GitHub Pull Request Builder プラグインの設定 ジョブの設定 動作確認 その他 すでに存在するプルリクでジョブをビルドし直す ジョブのビルド結果によってプルリクのチェックを変…

【Jenkins】jnlpjars/remoting.jarをロードできません

概要 jnlpjars/remoting.jarをロードできません Mac にインストールした Jenkins でスレーブを起動しようとしたら 上記のエラーが発生する現象に遭遇した 「Jenkinsの管理 > システムの設定 > Jenkinsの位置 > jenkins URL」を http://【Mac のコンピュータ…

【Xcode】cp: /Users/XXXX/Library/MobileDevice/Provisioning Profiles/YYYY.mobileprovision: No such file or directory

概要 cp: /Users/XXXX/Library/MobileDevice/Provisioning Profiles/YYYY.mobileprovision: No such file or directory 新しく購入した Mac で Jenkins のジョブをビルドして Xcode ビルドする際に、.mobileprovision を Library/MobileDevice/Provisioning …

【Unity】Failed to resolve packages: Failed to add editor bundled package

概要 Failed to resolve packages: Failed to add editor bundled package [/Applications/Unity/Hub/Editor/XXXX/Unity.app/Contents/Resources/PackageManager/Editor/com.unity.xr.arsubsystems-2.1.2.tgz] to the package cache: ENOTEMPTY: directory n…

【Xcode】Code Signing Error: Provisioning profile "XXXX" doesn't include the currently selected device "YYYY" (identifier ZZZZ).

概要 Code Signing Error: Provisioning profile "XXXX" doesn't include the currently selected device "YYYY" (identifier ZZZZ). Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 14.2' Code Signing Error: …

【Unity】Jenkins のフリースタイルジョブで Unity Test Runner を実行するサンプル

概要 シェルスクリプト rm -f -v ${WORKSPACE}/UnityProject/*.xml "/Applications/Unity/Hub/Editor/2020.1.6f1/Unity.app/Contents/MacOS/Unity" \ -batchmode \ -runEditorTests \ -projectPath ${WORKSPACE}/UnityProject \ -logFile - Test report XMLs…

【Jenkins】Slack と連携する基本的な方法(2020年9月版)

検証環境 Windows 10 Jenkins 2.249.1 Slack 4.9.0 Slack Notification 2.42 連携方法 Slack に Jenkins インテグレーションを追加 https://my.slack.com/services/new/jenkins-ci 上記のページにアクセスして Jenkins から通知を受け取るチャンネルを選択し…

【Jenkins】Mac 起動時に自動で Jenkins を起動する方法

概要 java -jar /Applications/Jenkins/jenkins.war 上記のコマンドを .command ファイルで保存して 「システム環境設定 > ユーザとグループ > ログイン項目」を開いて 「+」から上記の .command ファイルを選択します

【Jenkins】日時を指定してビルドできる「Schedule Build」紹介

はじめに 「Schedule Build」を Jenkins に追加することで 日時を指定してビルドできるようになります 使い方 ジョブのページで「Schedule Build」を選択することで 日時を指定してビルドできます 「Jenkinsの管理 > システムの設定 > Schedule Build Plugin…

【Jenkins】Sectioned View の List View Section のヘッダの文字サイズを変更する方法

概要 Jenkins に「Simple Theme」プラグインをインストールして 「Jenkins の管理 > システムの設定」の「Theme」の欄の「追加 > Extra CSS」を選択して .pane-frame h2 { font-size: 1rem; } を入力します 適用前 適用後

【Jenkins】実行予定のビルドの日時表記を変更する方法

概要 「Jenkins の管理 > システムの設定」を開いて 「Next Executions Configuration」の欄の「Date format」を yyyy/MM/dd HH:mm に変更する

【Jenkins】Jenkins Pipeline でタイムアウトした時のリザルトを Success にする方法

概要 pipeline { agent any stages { stage("Hello") { steps { script { timeout(time: 5, unit: "SECONDS") { sleep 10 echo "Hello World" } } } } // このステージはスキップされる stage("Hello2") { steps { echo "Hello World2" } } } } 通常、タイム…

【Jenkins】Jenkins Pipeline でステージごとにタイムアウトを設定する方法

概要 方法1 pipeline { agent any stages { stage("Hello") { steps { script { timeout(time: 5, unit: "SECONDS") { sleep 10 echo "Hello World" } } } } } } 方法2 pipeline { agent any stages { stage("Hello") { options { timeout(time: 5, unit: "S…

【Jenkins】フリースタイルのジョブをパイプラインに変換できるプラグイン「Declarative Pipeline Migration Assistant」メモ

概要 「Declarative Pipeline Migration Assistant」は フリースタイルのジョブをパイプラインに変換できるプラグインです デフォルトでは変換に対応していない機能も コンバータを自作することができます 参考サイト様

【Jenkins】ダークモードにできる「Dark Theme」紹介

はじめに 「Dark Theme」を Jenkins に追加することで ダークモードにできるようになります 使用例 使い方 「Jenkinsの管理 > システムの設定 > Themes」で「Dark」を選択します

【Jenkins】Jenkins Pipeline で他のジョブを実行した時に終了を待たない方法

概要 pipeline { agent any stages { stage('Hello') { steps { build( job: "【ジョブ名】", wait: false ) } } } } build する時に wait に false を設定する

【Jenkins】Jenkins Pipeline で定期的に実行を指定する方法

概要 pipeline { agent any triggers { cron( "0 10-19 * * *" ) } stages { stage('Hello') { steps { echo 'Hello World' } } } } triggers ディレクティブで指定する