我的 Jenkis CI 的一项工作是通过 ImageMagick 和 GhostScript 转换 PDF(嗯,简而言之,它最终会做到)。奇怪的是,当从命令行(通过 SSH)调用时,它可以工作,但在 Jenkins 中启动失败。更奇怪的是底层 gs 命令(convert 使用 gs 转换 PDF)有效。
脚本:
#!/bin/bash -e
export MAGICK_TMPDIR=`pwd`/tmp
/usr/local/bin/convert -verbose /Users/Shared/Jenkins/Home/jobs/test/workspace/example.pdf /Users/Shared/Jenkins/Home/jobs/test/workspace/example_1.jpg
詹金斯输出:
[workspace] $ /bin/bash -e /var/folders/hm/dm88jd4j2f328jj96hglfbk000009c/T/hudson3825950836307624243.sh
"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=/Users/Shared/Jenkins/Home/jobs/test/workspace/tmp/magick-QkcQLTEO-%08d" "-f/Users/Shared/Jenkins/Home/jobs/test/workspace/tmp/magick-b0tr61Ng" "-f/Users/Shared/Jenkins/Home/jobs/test/workspace/tmp/magick-scEOIbtN"
convert: Postscript delegate failed `/Users/Shared/Jenkins/Home/jobs/test/workspace/example.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/668.
convert: missing an image filename `/Users/Shared/Jenkins/Home/jobs/test/workspace/example_1.jpg' @ error/convert.c/ConvertImageCommand/3016.
Jenkins v. 1.496 在带有 Java 1.6.0_37 的 OS X 10.7.5 上运行