2016-10-28 176 views
1

Jenkinsからバッチファイルを実行しようとしていますが、実行できません。 ビルド前のステップでは、実行したいファイルを入力しましたが、以下に示すスタックトレースを取得します。 Jenkinsはcmdコマンドを認識しません。Jenkinsからバッチファイルを実行する方法

どうすればこの問題を解決できますか?

Started by user Jenkins 
[EnvInject] - Loading node environment variables. 
Building in workspace /srv/jenkins/workspace/gaa-integratietest-daily 
> git rev-parse --is-inside-work-tree # timeout=10 
Fetching changes from the remote Git repository 
> git config remote.origin.url ssh://[email protected]:7999/gaa/gaa_test_milieu.git # timeout=10 
Fetching upstream changes from ssh://[email protected]:7999/gaa/gaa_test_milieu.git 
> git --version # timeout=10 
> git -c core.askpass=true fetch --tags --progress ssh://[email protected]:7999/gaa/gaa_test_milieu.git +refs/heads/*:refs/remotes/origin/* 
> git rev-parse origin/develop^{commit} # timeout=10 
Checking out Revision 337d5b94e05f2c915e05de2c2535d5af180d4326 (origin/develop) 
> git config core.sparsecheckout # timeout=10 
> git checkout -f 337d5b94e05f2c915e05de2c2535d5af180d4326 
> git rev-list 337d5b94e05f2c915e05de2c2535d5af180d4326 # timeout=10 
[gaa-integratietest-daily] $ /bin/sh -xe /tmp/hudson1965771098535657790.sh 
+ cmd /c qclient.bat 
/tmp/hudson1965771098535657790.sh: line 2: cmd: command not found 
Build step 'Execute shell' marked build as failure 
[gaa-integratietest-daily] $ /usr/share/maven/bin/mvn -f pom.xml -gs /srv/maven/settings.xml clean deploy -fae 
[INFO] Scanning for projects... 
[ERROR] The build could not read 1 project -> [Help 1] 
[ERROR] 
[ERROR] The project (/srv/jenkins/workspace/gaa-integratietest-daily/pom.xml) has 1 error 
[ERROR]  Non-readable POM /srv/jenkins/workspace/gaa-integratietest-daily/pom.xml: /srv/jenkins/workspace/gaa-integratietest-daily/pom.xml (No such file or directory) 
[ERROR] 

答えて

0

Linux Jenkinsスレーブは、というcmdをサポートしていません。この問題を回避するには、いくつかのオプションがあります(より良いものから悪いものへ):

  1. WindowsスレーブをJenkinsに追加してそこからcmdを実行します。
  2. バッチファイルをbashなどに移植し、Linux Jenkinsのスレーブから実行します。
  3. Linux JenkinsのスレーブにDOSエミュレータ(Wine、DOSBox、DOSemu)を追加してください。

私のアドバイス:あなたは、Linux &バッシュを知っているか、オプション2ためジェンキンス行くのを制御することはできません場合。それ以外の場合は、オプション1に進みます。オプション3は避けてください。

0

LINUXマシンでCMDを実行しようとしています。実行しているスレーブをWindowsマシンに変更するか、バッチスクリプトをシェルスクリプトに移行してください。

幸運を祈る!

関連する問題