ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Installing WP-CLI, the WordPress Command Line, with SaltStack

    IT Discussion
    salt saltstack wp-cli wordpress
    1
    1
    956
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      This is written for Linux and tested on Fedora 25 but should really work on any UNIX system. This only needs one file and is only dependent on curl which is pretty much everywhere by default, I can't remember ever seeing a system without it. Just create this file on your Salt master and it is all that you need: /srv/salt/wp-cli/init.sls

      install-foo:
        cmd.run:
          - name: |
              cd /tmp
              curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
              chmod +x /tmp/wp-cli.phar
              mv /tmp/wp-cli.phar /usr/local/bin/wp
          - cwd: /tmp
          - shell: /bin/bash
          - timeout: 300
          - creates: /usr/local/bin/wp
      

      With this state file, the latest WP-CLI will be downloaded, set to be executable and placed into the standard command path. Once the state has been applied the wp standard command should be available to you. Perfect for anyone who has followed by SaltStack LAMP Install Guide and is planning to manage WordPress on their LAMP Stack.

      1 Reply Last reply Reply Quote 1
      • 1 / 1
      • First post
        Last post