Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WP-CLI 入門

WP-CLI 入門

WordCamp Kyoto 2017

Takayuki Miyauchi

June 24, 2017
Tweet

More Decks by Takayuki Miyauchi

Other Decks in Technology

Transcript

  1. wp core download --path=$(pwd) --locale=ja wp config create \ --dbhost=localhost

    \ --dbname=wordpress \ --dbuser=root \ --dbprefix=wp_ \ --locale=ja wp core install \ --url=http://127.0.0.1:8080 \ --title="WordPress" \ --admin_user="admin" \ --admin_password="admin" \ --admin_email="[email protected]" wp server --host=0.0.0.0 --port=8080 --docroot=$(pwd) https://gist.github.com/miya0001/f3e3aed260efa8823116500b5e70db74
  2. $ curl -O https://.../wp-cli.phar $ chmod 755 wp.phar $ mv

    wp.phar /usr/local/bin/wp $ wp --info https://wp-cli.org/#installing
  3. #!/usr/bin/env bash wp @all core update wp @all plugin update

    --all wp @all theme update --all wp @all core language update
  4. @live: - @vccw.dev @staging: - @example.dev $ wp @staging core

    update εςʔδϯάͱຊ൪ʹ෼͚࣮ͯߦ͢Δ͜ͱ΋Մೳ @staging ͷΈίΞΛΞοϓσʔτ
  5. - name: Run `wp plugin install` command: | wp plugin

    install {{ item }} --activate --path={{ path }} with_items: "{{ vccw.plugins }}" ϓϥάΠϯΛΠϯετʔϧ͢ΔͨΊͷ
 Ansible playbook ͷྫ https://github.com/vccw-team/vccw/blob/ master/provision/playbooks/wordpress.yml
  6. $ wp valet • Laravel ༻ͷ։ൃ؀ڥ Valet ্ʹ WordPress ؀ڥΛߏங

    • खͬऔΓૣ͘ WordPress Λ࡞ͬͨΓࣺͯͨΓ͢Δࡍʹศ རɻ https://github.com/aaemnnosttv/wp-cli-valet-command
  7. $ git clone wp-cli/media-command.git $ cd media-command $ composer install

    $ vendor/bin/behat όάͬΆ͍΋ͷΛݟ͚ͭͨΒ @miya0001 ʹ࿩͔͚ͯ͠΋Βͬͯ΋େৎ෉Ͱ͢ɻ