Comments (4)
The issue is that cd
is a shell built-in but runbook will split the string to invoke the first part as a binary to be executed and the second to be arguments to the binary.
Two options, (1) Use the path
setter: https://github.com/braintree/runbook#setters, or (2) you could pass raw: true
which will invoke the command using a shell. Note that if you pass raw: true
all setters besides the host will not apply to the command.
from runbook.
Thanks, that makes sense. But cd
is a built-in so what path would I be setting? I came across this possibility which gives an error "Directory does not exist", but it does!
section "check status" do
step "git pull" do
path "/home/rails/soa_demo"
command "git pull"
end
I also tried:
command "cd /home/rails/soa_demo; git pull", raw: true
Which seems to work. but as you say it defeats the other setters - I am not sure what that means. The setter I have at the "Runbook" level (server "xxx") seems to apply to the nested section>step>command even with raw.
Thanks for being so helpful!
from runbook.
path
designates the current working directory that the commands will be executed from. Specifying absolute paths for your commands and arguments is another option. It is surprising that it says the directory does not exist. Maybe that is on a different host? You could try to mkdir -p <the path>
in a step before you reference that path in a path
setter to ensure it exists.
If you specify raw: true
, specifically path
, user
, group
, env
, and umask
will have no effect on the command.
server
and servers
will continue to apply to all commands nested under the step or section where the servers are specified.
from runbook.
Thanks!
from runbook.
Related Issues (20)
- How does "previous position detected" work? HOT 2
- Dealing with errors HOT 2
- Long running processes HOT 5
- tmux_command HOT 2
- tmux_command doesn't seem to respect server HOT 2
- command `curl` doesn't do what I expected HOT 1
- Ability to set `report_on_exception = false`? HOT 2
- rescue from command Exception HOT 2
- Ruby 3 compatibility issue? :into keyword in `ask?` HOT 2
- Builds broken after version bump to 1.0
- Switch to Github Actions?
- Is Local Command Execution supported? HOT 1
- Add support for Ruby 3.1
- Crash when generating projects with `-`
- Jump to specific Position doesn't check input
- DidYouMean update
- Clarification: context of `path`
- Incompatibilities to tmux version 3.4 HOT 2
- Maintained repo or alternative HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from runbook.