Page MenuHomeDevCentral

Sample of Makefile for a Wordpress installation

Authored By
dereckson
Jun 23 2015, 22:44
Size
1 KB
Referenced Files
None
Subscribers
None

Sample of Makefile for a Wordpress installation

#
# Makefile for stages.wolfplex.be
#
# Database configuration
DB_HOST=localhost
DB_NAME=wolfplex_stages
DB_USER=wolfstages
DB_PASSWORD != openssl rand -hex 21
DB_ROOT_USER=root
# Site configuration
SITE_URL=https://stages.wolfplex.be
SITE_TITLE=Stages
SITE_ADMIN_USER=stages
SITE_ADMIN_PASS != openssl rand -hex 21
SITE_ADMIN_EMAIL=stages@wolfplex.be
# Main targets
all: wordpress wp-cli wordpress-plugins
wordpress: index.php wp-config.php
wp-cli: config.yml vendor/dereckson/wp-cli-polylang
wordpress-plugins: wp-content/plugins/polylang
# Wordpress targets
index.php:
wp core download
wp-config.php:
@echo "*** Root password to create ${DB_NAME} database and give access to ${DB_USER}:"
@mysql -h${DB_HOST} -u${DB_ROOT_USER} -p -e "CREATE DATABASE ${DB_NAME}; GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'localhost' IDENTIFIED BY '${DB_PASSWORD}';"
@wp core config --dbhost=${DB_HOST} --dbname=${DB_NAME} --dbuser=${DB_USER} --dbpass=${DB_PASSWORD}
@wp core install --url=${SITE_URL} --title=${SITE_TITLE} --admin_user=${SITE_ADMIN_USER} --admin_password=${SITE_ADMIN_PASS} --admin_email=${SITE_ADMIN_EMAIL}
@echo "*** Admin account temporary credentials:"
@echo " Login ...... ${SITE_ADMIN_USER}"
@echo " Password ... ${SITE_ADMIN_PASS}"
# Plugins
wp-content/plugins/polylang:
wp plugin get polylang
wp plugin activate polylang
# WP-CLI targets
config.yml:
composer init --stability dev --no-interaction
composer config bin-dir bin
composer config vendor-dir vendor
#composer config repositories.wp-cli composer 'http://wp-cli.org/package-index/'
echo "require:\n - vendor/autoload.php" > config.yml
vendor/dereckson/wp-cli-polylang:
composer require dereckson/wp-cli-polylang=dev-master

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3323
Default Alt Text
Sample of Makefile for a Wordpress installation (1 KB)

Event Timeline