2

How can I cd /path/to/repo && git pull in the ExecStartPre section of a systemd service?

refeniz
  • 131
  • 6
  • 1
    Whats your question? (if you are wondering about the `&&`, just wrap your commands in a shell, e.g.: `ExecStartPre=/bin/bash -c "command1 && command2"`) – anx Oct 17 '17 at 20:36
  • Oh nice, I think that would have worked too! Thanks. – refeniz Oct 17 '17 at 21:00

1 Answers1

1

I figured it out.. I also figured out how to use RVM to do some rails(y) things too:

WorkingDirectory=/path/to/repo

ExecStartPre=/usr/bin/git pull
ExecStartPre=/home/rails/.rvm/bin/rvm 2.3.1 do bundle install
ExecStartPre=/home/rails/.rvm/wrappers/ruby-2.3.1/rake assets:precompile
refeniz
  • 131
  • 6