How can I cd /path/to/repo && git pull
in the ExecStartPre
section of a systemd service?
Asked
Active
Viewed 1,090 times
2

refeniz
- 131
- 6
-
1Whats 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 Answers
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