gpt4 book ai didi

sbt-native-packager - 使用 sbt 将 Debian 软件包发布到 Artifactory

转载 作者:行者123 更新时间:2023-12-01 02:15:27 26 4
gpt4 key购买 nike

我正在使用 sbt-native-packager 为我的 Scala Play 2 项目创建 Debian 包并将其发布到 Artifactory 存储库。

到目前为止,我能够生成 .deb包,但我无法将其发布到工件 URL。唯一发布的工件是 debian .changes文件,但不是实际的 .deb文件。

我最近升级到使用 sbt 0.13.5 和 sbt-native-packager 0.7.4 的 Play 2.3.2。这可能是相关的,因为将 .deb 文件发布到 artifactory 确实曾经与 sbt-native-packager 0.7.1 一起使用。

我努力去理解这个问题,并发现在最新版本中我必须添加 debianChangelog in Debian := Some(file("src/debian/changelog"))到我的 .sbt文件,但我现在卡住了。

我的问题只是没有 .deb文件在我做时发布 debian:publish .只有.changes文件被发布:[info] published atk to http:...:8081/artifactory/atk-snapshots/atk/atk/1.0-SNAPSHOT/atk-1.0-SNAPSHOT.changes
有人知道我应该做什么来解决我的发布问题吗?

我在项目的 .sbt 文件中有以下设置作为导入和版本:

import com.typesafe.sbt.SbtNativePackager._
import com.typesafe.sbt.SbtNativePackager.NativePackagerKeys._
import com.typesafe.sbt.packager.archetypes.ServerLoader.SystemV
import NativePackagerKeys._

name := """atk"""

scalacOptions += "-target:jvm-1.7"

javacOptions ++= Seq("-source", "1.7", "-target", "1.7")

version := "1.1-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.1"

对于包装部分:
// Packaging info

debianChangelog in Debian := Some(file("src/debian/changelog"))

serverLoading in Debian := SystemV

packageDescription in Debian := "Parlis Elvis Adapter"

packageSummary in Debian := "Parlis Elvis Adapter"

maintainer in Debian := "Daan Hoogenboezem"

daemonUser in Linux := "ape"

daemonGroup in Linux := "ape"

sourceDirectory in Debian <<= (sourceDirectory) apply (_ / "debian")

mappings in Universal <+= (packageBin in Compile, sourceDirectory ) map { (_, src) =>
// we are using the reference.conf as default application.conf
// the user can override settings here
val conf = src / "linux" / "atk" / "startup.conf"
conf -> "etc/atk/startup.conf"
}

linuxPackageMappings in Debian <+= (name in Universal, sourceDirectory in Debian) map { (name, dir) =>
(packageMapping(
(dir / "etc/changelog") -> "/usr/share/doc/atk/changelog.gz"
) withUser "root" withGroup "root" withPerms "0644" gzipped) asDocs()
}

defaultLinuxLogsLocation in Linux := "/var/log/atk"

deploymentSettings

// Publishing
publishTo := {
val artifactory = "http://...:8081/artifactory/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at artifactory + "atk-snapshots")
else
Some("releases" at artifactory + "atk-releases")
}

publish in Debian <<= (publish in Debian).triggeredBy(publish in Compile)

最佳答案

我的一位同事向我展示了修复程序,该修复程序记录在此处:http://www.scala-sbt.org/sbt-native-packager/DetailedTopics/deployment.html?highlight=publish

总之,需要在build.sbt中加入如下语句:

makeDeploymentSettings(Debian, packageBin in Debian, "deb")

关于sbt-native-packager - 使用 sbt 将 Debian 软件包发布到 Artifactory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25229027/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com