lib/shuttle/deployment/wordpress/cli.rb
# Checkout a proper wp-cli revision. By default it'll install
# latest available tag from git. That's considered a stable version.
# To install latest code, set `cli` option in config:
#
#   wordpress:
#     cli: master 
#
Checkout a proper wp-cli revision. By default it'll install
latest available tag from git. That's considered a stable version.
To install latest code, set `cli` option in config.

master
Checkout a proper wp - cli revision . By default it ' ll install latest available tag from git . That ' s considered a stable version . To install latest code set ` cli ` option in config . master
def cli_checkout_code
      ssh.run("sudo git clone --recursive --quiet #{CLI_GIT} #{CLI_PATH}")
      if config.wordpress.cli.nil?
        tags = ssh.capture("cd #{CLI_PATH} && git tag").split("\n").map(&:strip).reverse
        tag  = tags.first
        rev  = ssh.capture("cd #{CLI_PATH} && git rev-parse #{tag}").strip
      else
        tag = config.wordpress.cli
        if tag =~ /^[\d\.]+$/ 
          tag = "v#{tag}" unless tag =~ /v[\d]+/
        end
        rev = tag
      end
      res = ssh.run("cd #{CLI_PATH} && sudo git checkout #{rev}")
      if res.failure?
        error "Unable to checkout revision #{rev}: #{res.output}"
      end
    end
def cli_checkout_code ssh . run ( "sudo git clone --recursive --quiet #{CLI_GIT} #{CLI_PATH}" ) if config . wordpress . cli . nil? tags = ssh . capture ( "cd #{CLI_PATH} && git tag" ) . split ( "\n" ) . map ( & :strip ) . reverse tag = tags . first rev = ssh . capture ( "cd #{CLI_PATH} && git rev-parse #{tag}" ) . strip else tag = config . wordpress . cli if tag =~ / ^[ \d \. ]+$ / tag = "v#{tag}" unless tag =~ / v[ \d ]+ / end rev = tag end res = ssh . run ( "cd #{CLI_PATH} && sudo git checkout #{rev}" ) if res . failure? error "Unable to checkout revision #{rev}: #{res.output}" end end
Checkout a proper wp-cli revision.
Checkout a proper wp - cli revision .
# version def #rev, tag