nickbreen / docker-wp-setup Goto Github PK
View Code? Open in Web Editor NEWScripted setup of a WP instance using WP-CLI
License: GNU General Public License v2.0
Scripted setup of a WP instance using WP-CLI
License: GNU General Public License v2.0
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"
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
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.
safecss
... 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!).
Split set up into two sections:
Just make them all scripts (perhaps even busybox style).
Maybe even promote them to WP commands!
Similar to new_site.
wp core language activate $WP_LOCALE
Otherwise it complains there are translation updates and wp core language update
doesn't update inactive languages.
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
Rather than
wp github plugin foo/bar
Expect
wp plugin github install foo/bar
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.
So, if it's needed gracefully fail.
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}");
}
which does not require the DB configured to install... i.e. no installation, just download.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.