Giter Club home page Giter Club logo

Comments (4)

pblesi avatar pblesi commented on July 28, 2024

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.

pitosalas avatar pitosalas commented on July 28, 2024

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.

pblesi avatar pblesi commented on July 28, 2024

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.

pitosalas avatar pitosalas commented on July 28, 2024

Thanks!

from runbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.