Git Product home page Git Product logo

docker-wp-setup's People

Contributors

nickbreen avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

docker-wp-setup's Issues

Add support for GitHub and Bitbucket via WP_CLI command

See:

Support:

Requires: support for OAuth

Should support all arguments for normal install of plugins and themes.

Example:

wp plugin-github install account/repo --version=v1.0.0 --token=XXXXXX
wp theme-bitbucket install account/repo --version=v1.0.0 --activate --key=XXXXX --secret=XXXXXX

Assume that this means we can remove almost all of the env vars and just have a list of commands!

environment:
  WP_EXTRA_PHP: |
    define('DISABLE_WP_CRON', true);
  WP_COMMANDS: |
    site create --slug=example.com --title=KidsLink [email protected]
    site list
    db query "UPDATE wp_blogs SET domain = 'example.com' WHERE domain = 'example.com"

errors when creating users

Error:
Array
(
    [curl] => 
    [Error] => Array
        (
            [Type] => Sender
            [Code] => InvalidParameterValue
            [Message] => Illegal address
        )

    [RequestId] => bbbba154-f094-11e5-8e09-a9b5be76ef0d
)
Error:
Array
(
    [curl] => 
    [Error] => Array
        (
            [Type] => Sender
            [Code] => InvalidParameterValue
            [Message] => Illegal address
        )

    [RequestId] => bc22c80a-f094-11e5-89de-173d7616c49e
)
Success: Created user 2.
Password: !JeWPf2QQc!s
Error:
Array
(
    [curl] => 
    [Error] => Array
        (
            [Type] => Sender
            [Code] => InvalidParameterValue
            [Message] => Illegal address
        )

    [RequestId] => bcfa3bc0-f094-11e5-8c0d-6738bc86c51c
)
Error:
Array
(
    [curl] => 
    [Error] => Array
        (
            [Type] => Sender
            [Code] => InvalidParameterValue
            [Message] => Illegal address
        )

    [RequestId] => bd5f6662-f094-11e5-9ff4-353490ec673a
)
Success: Created user 3.
Password: s4wAs#4kcaNM

Add info logs to SCM_Command so the log makes sense

E.g. this is not as helpful as one might expect.

Found release: https://api.github.com/repos/CherryFramework/CherryFramework/tarball/v3.1.5
Unpacking the package...
Installing the theme...
Removing the old version of the theme...
Theme updated successfully.
Success: Translations updates are not needed for the 'English (US)' locale.

Referencing a theme or plugin that does not exist explodes in horrible warnings.

... but it otherwise harmless.

tar (child): /var/www/v3.1.5: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Unpacking the package...
Installing the theme...
Warning: The package could not be installed. The theme is missing the <code>style.css</code> stylesheet.
Theme update failed.
Success: Translations updates are not needed for the 'English (US)' locale.
PHP Warning:  unlink(/var/www/v3.1.5): No such file or directory in /usr/local/share/php/SCM_Command.php on line 140
Warning: unlink(/var/www/v3.1.5): No such file or directory in /usr/local/share/php/SCM_Command.php on line 140

Also happens when the GitHub Personal Access Token is invalid (tokens are automatically invalidated if they are accidentally checked in!).

Support multisite

Split set up into two sections:

  1. "main" for setting up:
    • the main site
    • install plugins
    • install themes
    • network activate plugins
  2. "site" for setting up:
    • a single site,
    • enabling its plugins
    • enable its theme
    • configure plugins
    • configure theme

activate the locale if specified

wp core language activate $WP_LOCALE

Otherwise it complains there are translation updates and wp core language update doesn't update inactive languages.

error reporting for missing variables

E.g.

    wp core is-installed || wp core install \
        --url="${WP_URL:?WP_URL is required}" \
        --title="$WP_TITLE" \
        --admin_user="$WP_ADMIN_USER" \
        --admin_password="$WP_ADMIN_PASSWORD" \
        --admin_email="$WP_ADMIN_EMAIL" \
        --skip-email

Warning during mutlisite install.

Success: Generated wp-config.php file.
WordPress database error Table 'wordpress.wp_blogs' doesn't exist for query SELECT * FROM wp_blogs WHERE domain = 'wp.dev' AND path = '/' made by include('phar:///usr/local/share/php/wp-cli.phar/php/boot-phar.php'), include('phar:///usr/local/share/php/wp-cli.phar/php/wp-cli.php'), WP_CLI\Runner->start, WP_CLI\Runner->load_wordpress, require('phar:///usr/local/share/php/wp-cli.phar/php/wp-settings-cli.php'), require('wp-includes/ms-settings.php'), get_site_by_path
WordPress database error Table 'wordpress.wp_sitemeta' doesn't exist for query SELECT meta_value FROM wp_sitemeta WHERE meta_key = 'site_name' AND site_id = 1 made by include('phar:///usr/local/share/php/wp-cli.phar/php/boot-phar.php'), include('phar:///usr/local/share/php/wp-cli.phar/php/wp-cli.php'), WP_CLI\Runner->start, WP_CLI\Runner->load_wordpress, require('phar:///usr/local/share/php/wp-cli.phar/php/wp-settings-cli.php'), require('wp-includes/ms-settings.php'), WP_Network->__construct, WP_Network->_set_site_name, get_network_option
WordPress database error Table 'wordpress.wp_sitemeta' doesn't exist for query SELECT meta_value FROM wp_sitemeta WHERE meta_key = 'siteurl' AND site_id = 1 made by include('phar:///usr/local/share/php/wp-cli.phar/php/boot-phar.php'), include('phar:///usr/local/share/php/wp-cli.phar/php/wp-cli.php'), WP_CLI\Runner->start, WP_CLI\Runner->load_wordpress, require('phar:///usr/local/share/php/wp-cli.phar/php/wp-settings-cli.php'), wp_cookie_constants, get_site_option, get_network_option
Created single site database tables.
Set up multisite database tables.
Success: Network installed. Don't forget to set up rewrite rules.

Refactor SCM_Command to pure PHP (no shell_exec)

I.e.

  static protected function fetch_tarball($url, $auth = NULL) {
    if ($auth)
      $auth = "-u ${auth}";
    // TODO pure PHP
    return shell_exec("echo -n $(readlink -n -f .)/; curl -sfLJO -w '%{filename_effective}' ${auth} ${url}");
  }

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.