首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在运行Jenkins的MAC OS X Slave上构建错误"spawn spctl ENOENT“

在运行Jenkins的MAC OS X Slave上构建错误"spawn spctl ENOENT“
EN

Stack Overflow用户
提问于 2017-02-09 18:27:00
回答 1查看 840关注 0票数 0

我们在Jenkins服务器上安装了一个mac从服务器,它在我本地的开发人员机器上运行。它已经被电子/node.js用来创建应用程序。

Jenkins通过ssh和我的用户名/密码连接到我的os x机器。我可以看到,在构建过程中,我们的app-directory被创建并保存在我的机器上的指定位置。(slave.jar、工作区目录等)。

如果代码签名开始,Jenkins现在会遇到如下错误:

代码语言:javascript
运行
复制
[mac] [ExampleApp] Running shell script

[mac] + npm run dist-mac
[mac] 
[mac] > ExampleApp@1.3.3-beta dist-mac ../workspace/Example-App/ExampleApp
[mac] > build -m
[mac] 

[mac] Warning: "directories" in the root is deprecated, please specify in the "build"

[mac] Rebuilding native production dependencies for darwin:x64

[mac] Packaging for darwin x64 using electron 1.4.13 to ../ExampleApp-dist/mac

[mac] Signing app (identity: Developer ID Application: Example Company Name (ABCDEFGHIJKLMNOPQRSTUVWXYZ))
[mac] 

[mac] Error: spawn spctl ENOENT
[mac]     at exports._errnoException (util.js:1023:11)
[mac]     at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
[mac]     at onErrorNT (internal/child_process.js:359:16)
[mac]     at _combinedTickCallback (internal/process/next_tick.js:74:11)
[mac]     at process._tickCallback (internal/process/next_tick.js:98:9)
[mac] From previous event:
[mac]     at MacPackager.sign (/usr/local/lib/node_modules/electron-builder/out/macPackager.js:253:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/macPackager.ts:81:26
[mac] From previous event:
[mac]     at /usr/local/lib/node_modules/electron-builder/src/macPackager.ts:81:10
[mac]     at Generator.next (<anonymous>)
[mac] From previous event:
[mac]     at MacPackager.pack (/usr/local/lib/node_modules/electron-builder/out/macPackager.js:173:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/packager.ts:210:22
[mac] From previous event:
[mac]     at Packager.doBuild (/usr/local/lib/node_modules/electron-builder/out/packager.js:335:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/packager.ts:151:38
[mac]     at Generator.next (<anonymous>)
[mac]     at runCallback (timers.js:651:20)
[mac]     at tryOnImmediate (timers.js:624:5)
[mac]     at processImmediate [as _immediateCallback] (timers.js:596:5)
[mac] From previous event:
[mac]     at Packager.build (/usr/local/lib/node_modules/electron-builder/out/packager.js:261:11)
[mac]     at /usr/local/lib/node_modules/electron-builder/src/builder.ts:214:40
[mac]     at Generator.next (<anonymous>)
[mac] From previous event:
[mac]     at build (/usr/local/lib/node_modules/electron-builder/out/builder.js:63:21)
[mac]     at Object.<anonymous> (/usr/local/lib/node_modules/electron-builder/out/cli/build-cli.js:68:41)
[mac]     at Module._compile (module.js:571:32)
[mac]     at Object.Module._extensions..js (module.js:580:10)
[mac]     at Module.load (module.js:488:32)
[mac]     at tryModuleLoad (module.js:447:12)
[mac]     at Function.Module._load (module.js:439:3)
[mac]     at Module.runMain (module.js:605:10)
[mac]     at run (bootstrap_node.js:418:7)
[mac]     at startup (bootstrap_node.js:139:9)
[mac]     at bootstrap_node.js:533:3
[mac] 
[mac] npm ERR! Darwin 15.6.0
[mac] npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dist-mac"
[mac] npm ERR! node v7.5.0
[mac] npm ERR! npm  v4.1.2
[mac] npm ERR! code ELIFECYCLE
[mac] npm ERR! ExampleApp@1.3.3-beta dist-mac: `build -m`
[mac] npm ERR! Exit status 255
[mac] npm ERR! 
[mac] npm ERR! Failed at the ExampleApp@1.3.3-beta dist-mac script 'build -m'.
[mac] npm ERR! Make sure you have the latest version of node.js and npm installed.
[mac] npm ERR! If you do, this is most likely a problem with the ExampleApp package,
[mac] npm ERR! not with npm itself.
[mac] npm ERR! Tell the author that this fails on your system:
[mac] npm ERR!     build -m
[mac] npm ERR! You can get information on how to open an issue for this project with:
[mac] npm ERR!     npm bugs ExampleApp
[mac] npm ERR! Or if that isn't available, you can get their info via:
[mac] npm ERR!     npm owner ls ExampleApp
[mac] npm ERR! There is likely additional logging output above.
[mac] 
[mac] npm ERR! Please include the following file with any support request:
[mac] npm ERR!     ../workspace/Example-App/ExampleApp/npm-debug.log

有趣的是,如果我通过ssh从另一台机器手动连接到我的本地机器,并通过终端执行"build -m"-function,那么构建运行得很完美,没有错误。

我需要在首选项中设置什么,它也可以使用Jenkins-SSH?或者为什么我只能从詹金斯那里得到他的错误?

EN

回答 1

Stack Overflow用户

发布于 2017-02-09 19:34:23

对于我们的问题,我不认为这是一个理想的解决方案,但它至少是一种变通方法。

正如我们所建议的,如果我们从jenkins-ssh开始,问题在于缺少环境变量。因此,我们制作了一个脚本,它手动启动构建过程,并设置所有环境变量,如果我们在mac的终端上,可以通过命令'printenv‘获得这些变量-其中构建过程运行没有错误。

因此,我调用的脚本如下所示:

代码语言:javascript
运行
复制
#! /bin/sh
################################################################################
# starts build manually and sets environment variables manually before starting build
################################################################################
# first get environment-values with command "printenv" in terminal on the desired system, where build process runs 
# then set all line outputs with starting "export "; some example lines as follows
export SHELL=/bin/bash
export TERM=xterm-256color
export MAVEN_OPTS=-Xms1024m -Xmx3g -XX:PermSize=1024m
export PATH=/opt/subversion/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home
export CLASSPATH_SEP=:
export LANG=de_DE.UTF-8
export XPC_FLAGS=0x0
export XPC_SERVICE_NAME=0
export LESSCHARSET=latin1
export SHLVL=1
export HOME=/Users/exampleUser
export GIT_HOME=/usr/bin/
export TMP=/tmp
export LOGNAME=exampleUser
export CLASSPATH=
export GIT_SRC_HOME=/Users/exampleUser/git
export SECURITYSESSIONID=186a9
export _=/usr/bin/printenv

# now starts build
cd <path-To-App-Directory>
build -m

# if desired check if app is signed
#spctl --assess -vv "<path-to-build-application>"
#codesign --verify -vvvv "<path-to-build-application>"

我们不知道哪些行是必需的,但只要脚本运行,对我们来说一切都很好。

也许其他专家可能知道我们问题的专业解决方案。到目前为止,我们将此解决方案标记为正确答案。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42134136

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档