Skip to content

Instantly share code, notes, and snippets.

@dev-ext
Last active November 4, 2016 18:17
Show Gist options
  • Save dev-ext/73ebeff1952c002216d8e4be0b9e1fbe to your computer and use it in GitHub Desktop.
Save dev-ext/73ebeff1952c002216d8e4be0b9e1fbe to your computer and use it in GitHub Desktop.
Wpautomate

Wordpress theme development workflow

System requirement

Dependency Instalation

Check system requirement

git --version && node -v && bower -v && gulp -v && wp --version && php -v && which mysql && uname -a

Adding vertual host

Add below code in .conf file located in /etc/apache2/sites-available/

<VirtualHost *:80>
	ServerName www.example.com
	ServerAdmin webmaster@localhost
	DocumentRoot /home/dev/dev/wpautomate
</VirtualHost>

Then restart apache2 sudo /etc/init.d/apache2 restart

Then edit host file located at /etc/hosts add below code 127.0.0.1 www.example.com

Creating new project

Create the new directory in your apache document root or your choices. cd {your directory} Enter your project directory yo wp-automate to generate WordPress project structure Select appropriate options from generator prompt

Understanding automation

  • Download latest wordpress from wordpress.org
  • Install npm for automation
  • Install bower dependency for front end
  • Install wpautomate themes from github/bitbucket
  • Rename theme with your project dir name
  • Create database
  • Install wordpress
  • Remove unused theme and plugins
  • Install unit testing data

Workflow with git

  • Create git repo in wordpress project root
  • Create sub module for uploads dir
  • Understanding .gitignore

Create a git reposotiry. Run git init in project root. Create a git repository in wp-content/uploads/ . cd wp-content/uploads/ then run git init. Back to root directory cd ../../. Add submoule git submodule git submodule add git@mygithost:projectname-uploads wp-content/uploads.

Deploy

Upload in bitbucket

  • git remote add [REPO URL]
  • git push origin master

Upload in dev server

Method 1:

  • Create git repo in dev server
  • git remote add deploy [dev server]
  • git push deploy master

Method 2:

  • clone git repo in dev server
  • git remote add origin [bitbucket server]
  • git pull origin master

Shell script

  • Modifying setup script
  • Modifying package script

Video Tutorial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment