`
sillycat
  • 浏览: 2551759 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

DevOps(3)Build RPM and DEB

 
阅读更多

DevOps(3)Build RPM and DEB

We are using maven plugin and sbt plugin to build rpm packages. I will check that and think about how to build deb because that we are thinking about change to ubuntu system.

I only try build universal package from sbt tool, all the examples are in sillycat-graph project.

Add plugins in plugins.sbt

addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.11.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0")
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0")
resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.7.0-SNAPSHOT")
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.8.0-M1")

Using Packaging.scala to Place all the native-package configuration

import sbt._
import Keys._
import com.typesafe.sbt.packager.Keys._
import com.typesafe.sbt.SbtNativePackager._

object Packaging {


  def app = packageArchetype.java_application

  def server = packageArchetype.java_server

  def settings: Seq[Setting[_]] =
      packagerSettings ++
      deploymentSettings ++
      Seq(
        publishArtifact in (Compile, packageBin) := false,
        publishArtifact in (Universal, packageBin) := true
      )

}

Change the Build.scala to using the native plugin
lazy val main = Project(
    BuildSettings.projectName,
    file("."),
    settings = BuildSettings.buildSettings ++ assemblySettings
    ++
    Seq(resolvers := myResolvers,
        libraryDependencies ++= baseDeps,
        mergeStrategy in assembly := mergeFirst
    )
    ++
    Packaging.settings
    ++
    Packaging.server
  ) settings(
    mainClass in assembly := Some("com.sillycat.graph.app.ExecutorApp"),
    excludedJars in assembly <<= (fullClasspath in assembly) map { cp =>
      cp filter {_.data.getName == "compile-0.1.0.jar"}
    },
    artifact in (Compile, assembly) ~= { art =>
      art.copy(`classifier` = Some("assembly"))
    },
    mappings in Universal <++= sourceDirectory  map { src =>
      val resources = src / "main" / "resources"
      val log4j = resources / "log4j.properties"
      val reference = resources / "application.conf"
      Seq(log4j -> "conf/log4j.properties", reference -> "conf/application.conf")
    }
  )

Command to generate the universal package
>sbt clean update compile universal:packageBin






References:
http://mojo.codehaus.org/unix/
https://github.com/sbt/sbt-native-packager

http://www.scala-sbt.org/sbt-native-packager/
example
https://github.com/muuki88/sbt-native-package-server#master

分享到:
评论

相关推荐

    DevOps, DBAs, and DBaaS(Apress,2016)

    Learn how DBAs in a DevOps environment manage data platforms and change requests to support and optimize continuous integration, delivery, testing, and deployment in the application development life ...

    DevOps with Kubernetes and Helm

    本文以“DevOps with Kubernetes and Helm”为标题,围绕DevOps理念与Kubernetes、Helm这两个工具的结合使用展开了讨论。DevOps是一种融合了人员、流程和技术的实践,以实现持续地向最终用户交付价值。在描述中,...

    Introduction to DevOps with Chocolate, LEGO and Scrum Game.pdf

    If you are familiar with the origin of the DevOps term, and can’t wait to start facilitating the game, feel free to skip this chapter. Otherwise, read on to learn about people and ideas that brought ...

    Starting and Scaling DevOps in the Enterprise

    Starting and Scaling DevOps in the Enterprise,Starting and Scaling DevOps in the Enterprise

    Accelerate_The Science of Lean Software and DevOps 2018.epub

    Beginning in late 2013, we embarked on a four-year research journey to investigate what capabilities and practices are important to accelerate the development and delivery of software and, in turn, ...

    Mobile DevOps-Packt Publishing(2018).epub

    Mobile DevOps is the future of continuous integration and continuous delivery for mobile application development, and is a very important requirement of today's fast-paced development culture....

    The DevOps 2.2 Toolkit

    overview of DevOps tools and practices and The DevOps 2.1 Toolkit: Docker Swarm: Building, testing, deploying, and monitoring services inside Docker Swarm clusters for an in depth examination of how ...

    DevOps an IBM point of view

    DevOps started as a culture and set of practices to support collaboration and communication across development and oper- ations, and to apply automation to key phases of the software delivery process....

    Implementing.DevOps.on.AWS.epub

    Build, Test, and Release Faster with Continuous Integration Chapter 5. Ever-Ready to Deploy Using Continuous Delivery Chapter 6. Continuous Deployment - A Fully Automated Workflow Chapter 7. Metrics,...

    DevOps落地实践合集.zip

    DevOps 五大理念及其落地实践 研发运维一体化(DevOps)成熟度模型 中国DevOps现状调查报告及解读 构建企业DevOps的度量体系 DevOps实践指南精要 分布式敏捷和DevOps实践案例 AWS DevOps 助力爱乐奇大规模业务扩展 ...

Global site tag (gtag.js) - Google Analytics