Skip to content
Snippets Groups Projects
Commit a1d86507 authored by ale's avatar ale
Browse files

Refine wp-cli installation

parent f67bd20f
No related branches found
No related tags found
No related merge requests found
Pipeline #14800 failed
......@@ -78,11 +78,24 @@ mkdir -p /opt/noblogs/www/wp-content/blogs.dir
mkdir -p /opt/noblogs/www/wp-content/cache
mkdir -p /var/lib/php/uploads
# Install wp-cli directly from the net.
# Install wp-cli directly from the net, along with minimal
# configuration, passed via a wrapper.
curl -o /usr/bin/wp-cli.phar https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
cat > /etc/wp-cli.yml <<EOF
path: /opt/noblogs/www
color: false
user: admin
disabled_commands:
- db drop
- plugin install
EOF
chmod 0644 /etc/wp-cli.yml
cat > /usr/bin/wp <<EOF
#!/bin/sh
exec /usr/bin/php /usr/bin/wp-cli.phar --path=/opt/noblogs/www "\$@"
export WP_CLI_CONFIG_PATH=/etc/wp-cli.yml
export WP_CLI_CUSTOM_SHELL=/bin/sh
export WP_CLI_DISABLE_AUTO_CHECK_UPDATE=1
exec /usr/bin/php /usr/bin/wp-cli.phar "\$@"
EOF
chmod 0755 /usr/bin/wp /usr/bin/wp-cli.phar
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment