How to use CHEF to run JAR?

I have a working jar file in an ubuntu virtual machine. I need to create a chef recipe to:

  • Run jar - (for example: run the command: java -jar name.jar)
  • Stop execution - when deploying a new can.

Can this be achieved with CHEF?

Regards, Aditya Chaudhary

+4
source share
1 answer

There are many options. Most likely the easiest:

execute "run file.jar in directory" do
  command "java -jar file.jar"
  cwd "directory containing jar file"
  action :run
end

jar , Chef . -. , jar , : Jar

+3

All Articles