0
我们使用sbt构建基于Play框架的后端。
目前我们使用sbt dist并运行构建二进制文件。
我正在将它构建到RPM包中,并且在此过程中引发了一些错误。
我发现这个回购协议 - https://github.com/muuki88/sbt-native-packager-examples 跑了SBT干净RPM:包斌都转相关子目录下 - RPM-SIGAR和简单转,同样的错误提出了,就像在我的项目,请看到回溯:sbt-native-packager RPM问题
[email protected] ~/coding/sbt-native-packager-examples/simple-rpm $ sbt clean rpm:package-bin
[info] Loading project definition from /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/project
[info] Set current project to simple-rpm (in build file:/home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/)
[success] Total time: 0 s, completed Aug 23, 2016 6:54:33 PM
[info] Packaging /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/scala-2.10/simple-rpm_2.10-1.0-sources.jar ...
[info] Done packaging.
[info] Updating {file:/home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/}simple-rpm...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Main Scala API documentation to /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/scala-2.10/api...
[info] Wrote /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/scala-2.10/simple-rpm_2.10-1.0.pom
[info] Compiling 1 Scala source to /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/scala-2.10/classes...
[warn] there were 1 feature warning(s); re-run with -feature for details
model contains 4 documentable templates
[warn] one warning found
[info] Main Scala API documentation successful.
[info] Packaging /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/scala-2.10/simple-rpm_2.10-1.0-javadoc.jar ...
[info] Done packaging.
[warn] there were 1 feature warning(s); re-run with -feature for details
[warn] one warning found
[info] Packaging /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/scala-2.10/simple-rpm_2.10-1.0.jar ...
[info] Done packaging.
[error] + umask 022
[error] + cd /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/rpm/BUILD
[error] + [ -e /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/rpm/buildroot ]
[error] + mv /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/rpm/tmp-buildroot/etc /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/rpm/tmp-buildroot/usr /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/rpm/tmp-buildroot/var /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/rpm/buildroot
[error] + /usr/lib/rpm/brp-compress
[error] + /usr/lib/rpm/brp-strip /usr/bin/strip
[info] Building target platforms: noarch-mukis.de-Linux
[info] Building for target noarch-mukis.de-Linux
[info] Executing(%install): /bin/sh -e /tmp/sbt_53b70991/rpm-tmp.yZCzUZ
[error] + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
[error] + /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
[info] Processing files: simple-rpm-1.0-1.noarch
[info] Provides: config(simple-rpm) = 1.0-1 simple-rpm = 1.0-1
[info] Requires(interp): /bin/sh /bin/sh /bin/sh /bin/sh
[info] Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
[info] Requires(pre): /bin/sh
[info] Requires(post): /bin/sh
[info] Requires(preun): /bin/sh
[info] Requires(postun): /bin/sh
[info] Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/rpm/buildroot
[info] Wrote: /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/rpm/RPMS/noarch/simple-rpm-1.0-1.noarch.rpm
[info] Executing(%clean): /bin/sh -e /tmp/sbt_53b70991/rpm-tmp.e0IrHo
[error] + umask 022
[error] + cd /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/rpm/BUILD
[error] + /bin/rm -rf /home/oreststetsiak/coding/sbt-native-packager-examples/simple-rpm/target/rpm/buildroot
[error] + exit 0
[success] Total time: 3 s, completed Aug 23, 2016 6:54:36 PM
我的工作站是Linux Mint的18为主,这是DEB, 我也试过在AWS EC2构建它在RedHat 7.2 - 同样的错误,
这种错误呢不要在Jenkins CI中打破构建,但是我不希望在构建日志中看到它。
有什么建议吗?
这是好的,thanx和一个更多的任务:我们使用了很多env varieblas,并且服务很好,以防万一,如果我手动将所有这些env variebles添加到启动脚本中,这是一个好方法吗?你如何/在哪里建议保留一堆有感知性的env变量?问候!感谢您的帮助.... –
根据我的经验,敏感的env变量不应该是启动脚本的一部分,也不应将它们检入您的回购。游戏应用的秘密就是一个很好的例子。它们应该由正在运行服务的系统提供(这就是为什么它们被称为环境变量的原因;))。请与您的操作人员讨论:) – Muki
确实“他们应该由您正在运行服务的系统提供”意味着所有的env变量都应该是全局环境变量,可以使用命令** env **?事实上,我们已经在env varialbes列表中播放应用程序秘密**,其他env变量(如S3用户,DB url,数据库用户名/密码等)正在创建期间创建AWS Cloud Formation Template –