-2

I need help in writing chef recipes. I have some jobs in Jenkins and they are done by Execute Windows batch command. I have to rewrite this commands to chef recipe but I can't become familiar with writing these recipes... I need some example of this kind of "rewriting".

For instance, this command:

D: && cd D:\[some path] && pc.exe "\\[some folder]" -u "admin" -p [pass] cmd /c "c: && cd C:\some folders]\ && install.bat"

need to be rewrite to chef reciepe. I can show other commands if it is needed.

I would by grateful to all kind of help

pulpet112
  • 43
  • 2
  • 10
  • "but I can't become familiar with writing these recipes..." <- ??? Are you saying you don't want to learn and asking for someone else to do the job for you ? – Tensibai Jul 13 '16 at 12:24
  • No. I mean that I'm beginner with writing recipes. I read documentation, I have basic theoretical knowlege but I have problems with practical use. I have command and I have to convert it to chef recipe, I have a lots of commands like this. Here I am asking for one example how to do this, not doing my job by somone else. – pulpet112 Jul 13 '16 at 13:21

1 Answers1

0

Something along the line:

execute "install" do
  command %Q{pc.exe "\\[some folder]" -u "admin" -p [pass] cmd /c "cd /D C:\some folders] && install.bat"}
  cwd "d:\[some path]"
end

should do. Without any insight on what does this command at all, it's hard to give a better advice, as for the placeholders, using attributes should be the way to go, but it's hard to tell without an entry point.

More details in the documentation

Tensibai
  • 15,557
  • 1
  • 37
  • 57