Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to insert a custom command into start script #1007

Closed
nonpool opened this issue Jul 20, 2017 · 3 comments
Closed

how to insert a custom command into start script #1007

nonpool opened this issue Jul 20, 2017 · 3 comments
Labels
universal Zip, tar.gz, tgz and bash issues

Comments

@nonpool
Copy link

nonpool commented Jul 20, 2017

i want to add a mkdir command into start script.
i use command 'dist' to package.
only insert into linux script is ok.
Please excuse my poor English

@muuki88 muuki88 added the universal Zip, tar.gz, tgz and bash issues label Jul 22, 2017
@muuki88
Copy link
Contributor

muuki88 commented Jul 22, 2017

Hi @bulecode

Please excuse my poor English

No worries :)

i want to add a mkdir command into start script.

The customize section in the docs should give you the hints you need.

If you simply want to add a folder I recommend reading the customize mappings section for the universal plugin, which helps you adding content to your package.

@muuki88 muuki88 closed this as completed Jul 22, 2017
@nonpool
Copy link
Author

nonpool commented Jul 25, 2017

@muuki88
first,thank you very much.
i want to add a empty folder in my package.
when i see you suggestion , i thank use script is fool ,
but when i try to solve it in build.sbt is always failed,
my build.sbt file main content:

enablePlugins(JavaServerAppPackaging)

mappings in Universal ++= {
  // optional example illustrating how to copy additional directory
  directory("scripts") ++
    // copy configuration files to config directory
    contentOf("src/main/resources").filter(x => !x._2.endsWith("Mapper.xml"))
      .filter(x => !x._2.equals("mybatis-config.xml")).toMap.mapValues("config/" + _)
}



scriptClasspath := Seq("../config/") ++ Seq("*")

javaOptions in Universal ++= Seq(
  // -J params will be added as jvm parameters X开头的jvm参数需要 -J
//  "-J-Xmx64m",
//  "-J-Xms64m",
  "-J-XX:+UseG1GC",
  "-J-Xloggc:../edr3logs/gc.log"
//  "-Dcom.sun.management.jmxremote.port=1090",
//  "-Dcom.sun.management.jmxremote.ssl=false",
//  "-Dcom.sun.management.jmxremote.authenticate=false"
)
//生成jvm配置文件
bashScriptConfigLocation := Some("${app_home}/../config/jvm.ini")

so,please you help me complete this code. empty folder name is edr3logs

@muuki88
Copy link
Contributor

muuki88 commented Aug 7, 2017

Try adding these files under src/universal/scripts and you have to do nothing in your build.sbt :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
universal Zip, tar.gz, tgz and bash issues
Projects
None yet
Development

No branches or pull requests

2 participants